Skip to content

Commit

Permalink
Merge pull request #17 from vaproloff/dev
Browse files Browse the repository at this point in the history
Added breezer reset filters service
  • Loading branch information
vaproloff authored Nov 7, 2024
2 parents 9bd4a06 + 44dc0ee commit 25c3b8d
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 67 deletions.
2 changes: 1 addition & 1 deletion custom_components/tion/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Platform for sensor integration."""
"""Platform for binary sensor integration."""

import abc
import logging
Expand Down
13 changes: 13 additions & 0 deletions custom_components/tion/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ async def async_setup_entry(
"set_breezer_max_speed",
)

platform.async_register_entity_service(
name="reset_filters",
schema=None,
func="async_reset_filters",
)

return True


Expand Down Expand Up @@ -561,6 +567,13 @@ async def set_breezer_max_speed(self, **kwargs):
self._speed_max_set = new_max_speed
await self._send_breezer()

async def async_reset_filters(self, **kwargs):
"""Reset breezer filter replacement."""
_ = kwargs
await self._api.send_settings(
self._breezer_guid, data={"reset_filter_timer": True}
)

async def _load_breezer(self, force=False):
"""Update breezer data from API."""
if device_data := await self._api.get_device(
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tion/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/vaproloff/tion_home_assistant/issues",
"requirements": [],
"version": "2024.11.0"
"version": "2024.11.1"
}
10 changes: 9 additions & 1 deletion custom_components/tion/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,12 @@ set_breezer_max_speed:
min: 0
max: 6
step: 1
mode: slider
mode: slider

reset_filters:
name: Reset Filters
description: Resets breezer filter replacement period. Require some time for replacement period to be updated - please, be patient after service activation.
target:
entity:
integration: tion
domain: climate
42 changes: 42 additions & 0 deletions custom_components/tion/strings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"title": "Tion",
"config": {
"step": {
"user": {
"title": "Add new Tion configuration",
"description": "Please enter your Tion account credentials",
"data": {
"name": "[%key:common::config_flow::data::name%]",
"username": "Username",
"password": "Password",
"scan_interval": "API poll interval"
},
"data_description": {
"scan_interval": "Tion devices data minimum update period."
}
}
},
"abort": {
"already_configured": "Account is already configured"
},
"error": {
"invalid_auth": "Invalid authentication",
"unknown": "Unexpected error"
}
},
"entity": {
"climate": {
"tion_breezer": {
"state_attributes": {
"swing_mode": {
"state": {
"outside": "Outside",
"inside": "Inside",
"mixed": "Mixed"
}
}
}
}
}
}
}
36 changes: 0 additions & 36 deletions custom_components/tion/translations/en.json

This file was deleted.

66 changes: 38 additions & 28 deletions custom_components/tion/translations/ru.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,46 @@
{
"config": {
"abort": {
"already_configured": "Устройство уже было добавлено"
"config": {
"step": {
"user": {
"title": "Новая конфигурация Tion",
"description": "Введите данные учётной записи Tion",
"data": {
"username": "Логин",
"password": "Пароль",
"scan_interval": "Интервал обновления"
},
"error": {
"invalid_auth": "Ошибка аутентификации",
"unknown": "Непредвиденная ошибка"
},
"step": {
"user": {
"description": "Введите данные учётной записи Tion:",
"data": {
"username": "Логин",
"password": "Пароль",
"scan_interval": "Интервал обновления"
}
}
"data_description": {
"scan_interval": "Минимальный период обновления данных устройств Tion от API."
}
}
},
"abort": {
"already_configured": "Учётная запись уже была добавлена"
},
"entity": {
"climate": {
"tion_breezer": {
"state_attributes": {
"swing_mode": {
"state": {
"outside": "С улицы",
"inside": "Из комнаты",
"mixed": "Смешанный"
}
}
}
"error": {
"invalid_auth": "Ошибка аутентификации",
"unknown": "Неизвестная ошибка"
}
},
"entity": {
"climate": {
"tion_breezer": {
"state_attributes": {
"swing_mode": {
"state": {
"outside": "С улицы",
"inside": "Из комнаты",
"mixed": "Смешанный"
}
}
}
}
}
},
"services": {
"reset_filters": {
"name": "Сбросить фильтры",
"description": "Сбрасывает период замены фильтров бризера. Обновление периода замены может занять некоторое время - после запуска службы, пожалуйста, ожидайте."
}
}
}

0 comments on commit 25c3b8d

Please sign in to comment.