From a4ec3290bac34c24de3239aa16b808a723df4c97 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Wed, 17 May 2023 00:01:33 +0200 Subject: [PATCH] Many air conditioner fixes for #52 --- README.md | 23 ++++--- custom_components/hon/binary_sensor.py | 18 +++++- custom_components/hon/climate.py | 21 ++++--- custom_components/hon/config_flow.py | 2 +- custom_components/hon/const.py | 2 +- custom_components/hon/hon.py | 4 +- custom_components/hon/select.py | 1 - custom_components/hon/sensor.py | 70 +++++++++++++++++++++- custom_components/hon/switch.py | 26 +++++++- custom_components/hon/translations/cs.json | 3 + custom_components/hon/translations/de.json | 3 + custom_components/hon/translations/el.json | 3 + custom_components/hon/translations/en.json | 3 + custom_components/hon/translations/es.json | 3 + custom_components/hon/translations/fr.json | 3 + custom_components/hon/translations/he.json | 3 + custom_components/hon/translations/hr.json | 3 + custom_components/hon/translations/it.json | 3 + custom_components/hon/translations/nl.json | 3 + custom_components/hon/translations/pl.json | 3 + custom_components/hon/translations/pt.json | 3 + custom_components/hon/translations/ro.json | 3 + custom_components/hon/translations/ru.json | 3 + custom_components/hon/translations/sk.json | 3 + custom_components/hon/translations/sl.json | 3 + custom_components/hon/translations/sr.json | 3 + custom_components/hon/translations/tr.json | 3 + custom_components/hon/translations/zh.json | 3 + scripts/generate_translation.py | 1 + scripts/sensor_docs.py | 4 +- 30 files changed, 199 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 9e2d912..45595e8 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ For every device exists a hidden button which can be used to log all infos of yo | Air Conditioner | `air-conditioner` | `climate` | `settings` | | Echo | `account-voice` | `switch` | `settings.echoStatus` | | Eco Mode | | `switch` | `settings.ecoMode` | +| Eco Pilot | `run` | `select` | `settings.humanSensingStatus` | | Health Mode | `medication-outline` | `switch` | `settings.healthMode` | | Mute | `volume-off` | `switch` | `settings.muteStatus` | | Rapid Mode | `run-fast` | `switch` | `settings.rapidMode` | @@ -162,15 +163,21 @@ For every device exists a hidden button which can be used to log all infos of yo | Self Cleaning | `air-filter` | `switch` | `settings.selfCleaningStatus` | | Self Cleaning 56 | `air-filter` | `switch` | `settings.selfCleaning56Status` | | Silent Sleep | `bed` | `switch` | `settings.silentSleepStatus` | -#### Configs -| Name | Icon | Entity | Key | -| --- | --- | --- | --- | -| Program | | `select` | `startProgram.program` | +| Target Temperature | `thermometer` | `number` | `settings.tempSel` | #### Sensors | Name | Icon | Entity | Key | | --- | --- | --- | --- | -| Eco Pilot | `run` | `select` | `settings.humanSensingStatus` | -| Target Temperature | `thermometer` | `number` | `settings.tempSel` | +| Air Temperature Outdoor | `thermometer` | `sensor` | `tempAirOutdoor` | +| Ch2O Cleaning | | `binary_sensor` | `ch2oCleaningStatus` | +| Coiler Temperature Indoor | `thermometer` | `sensor` | `tempCoilerIndoor` | +| Coiler Temperature Outside | `thermometer` | `sensor` | `tempCoilerOutdoor` | +| Defrost Temperature Outdoor | `thermometer` | `sensor` | `tempDefrostOutdoor` | +| Filter Replacement | | `binary_sensor` | `filterChangeStatusLocal` | +| In Air Temperature Outdoor | `thermometer` | `sensor` | `tempInAirOutdoor` | +| Indoor Temperature | `thermometer` | `sensor` | `tempIndoor` | +| Outdoor Temperature | `thermometer` | `sensor` | `tempOutdoor` | +| Program | | `select` | `startProgram.program` | +| Selected Temperature | `thermometer` | `sensor` | `tempSel` | ### Dish washer #### Controls @@ -262,6 +269,8 @@ For every device exists a hidden button which can be used to log all infos of yo | Name | Icon | Entity | Key | | --- | --- | --- | --- | | Auto-Set Mode | `thermometer-auto` | `switch` | `settings.intelligenceMode` | +| Freezer Temperature | `thermometer` | `number` | `settings.tempSelZ2` | +| Fridge Temperature | `thermometer` | `number` | `settings.tempSelZ1` | | Super Cool | `snowflake` | `switch` | `settings.quickModeZ2` | | Super Freeze | `snowflake-variant` | `switch` | `settings.quickModeZ1` | #### Configs @@ -274,8 +283,6 @@ For every device exists a hidden button which can be used to log all infos of yo | Auto-Set Mode | `thermometer-auto` | `binary_sensor` | `intelligenceMode` | | Door Status Freezer | `fridge-top` | `binary_sensor` | `doorStatusZ1` | | Door Status Fridge | `fridge-bottom` | `binary_sensor` | `door2StatusZ1` | -| Freezer Temperature | `thermometer` | `number` | `settings.tempSelZ2` | -| Fridge Temperature | `thermometer` | `number` | `settings.tempSelZ1` | | Holiday Mode | `palm-tree` | `binary_sensor` | `holidayMode` | | Room Humidity | `water-percent` | `sensor` | `humidityEnv` | | Room Temperature | `home-thermometer-outline` | `sensor` | `tempEnv` | diff --git a/custom_components/hon/binary_sensor.py b/custom_components/hon/binary_sensor.py index e9d3e0b..0a44cd9 100644 --- a/custom_components/hon/binary_sensor.py +++ b/custom_components/hon/binary_sensor.py @@ -1,6 +1,8 @@ import logging from dataclasses import dataclass +from pyhon import Hon + from homeassistant.components.binary_sensor import ( BinarySensorEntityDescription, BinarySensorDeviceClass, @@ -8,8 +10,6 @@ from homeassistant.components.binary_sensor import ( ) from homeassistant.config_entries import ConfigEntry from homeassistant.core import callback -from pyhon import Hon - from .const import DOMAIN from .hon import HonCoordinator, HonEntity, unique_entities @@ -179,6 +179,20 @@ BINARY_SENSORS: dict[str, tuple[HonBinarySensorEntityDescription, ...]] = { translation_key="door_open", ), ), + "AC": ( + HonBinarySensorEntityDescription( + key="filterChangeStatusLocal", + name="Filter Replacement", + device_class=BinarySensorDeviceClass.PROBLEM, + on_value="1", + translation_key="filter_replacement", + ), + HonBinarySensorEntityDescription( + key="ch2oCleaningStatus", + name="Ch2O Cleaning", + on_value="1", + ), + ), "REF": ( HonBinarySensorEntityDescription( key="quickModeZ2", diff --git a/custom_components/hon/climate.py b/custom_components/hon/climate.py index 7058ced..29b7764 100644 --- a/custom_components/hon/climate.py +++ b/custom_components/hon/climate.py @@ -1,5 +1,8 @@ import logging +from pyhon import Hon +from pyhon.appliance import HonAppliance + from homeassistant.components.climate import ( ClimateEntity, ClimateEntityDescription, @@ -20,9 +23,6 @@ from homeassistant.const import ( TEMP_CELSIUS, ) from homeassistant.core import callback -from pyhon import Hon -from pyhon.appliance import HonAppliance - from .const import HON_HVAC_MODE, HON_FAN, HON_HVAC_PROGRAM, DOMAIN from .hon import HonEntity, HonCoordinator @@ -107,6 +107,7 @@ class HonClimateEntity(HonEntity, ClimateEntity): ] await self._device.commands["startProgram"].send() self._attr_hvac_mode = hvac_mode + self.async_write_ha_state() async def async_set_fan_mode(self, fan_mode): mode_number = list(HON_FAN.values()).index(fan_mode) @@ -114,6 +115,7 @@ class HonClimateEntity(HonEntity, ClimateEntity): mode_number ] await self._device.commands["settings"].send() + self.async_write_ha_state() async def async_set_swing_mode(self, swing_mode): horizontal = self._device.settings["settings.windDirectionHorizontal"] @@ -128,29 +130,29 @@ class HonClimateEntity(HonEntity, ClimateEntity): horizontal.value = "0" self._attr_swing_mode = swing_mode await self._device.commands["settings"].send() + self.async_write_ha_state() async def async_set_temperature(self, **kwargs): if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None: return False - self._device.settings["settings.tempSel"].value = int(temperature) + self._device.settings["settings.tempSel"].value = str(int(temperature)) await self._device.commands["settings"].send() + self.async_write_ha_state() @callback def _handle_coordinator_update(self, update=True) -> None: self._attr_target_temperature = int(float(self._device.get("tempSel"))) self._attr_current_temperature = float(self._device.get("tempIndoor")) - self._attr_max_temp = self._device.settings["settings.tempSel"].max - self._attr_min_temp = self._device.settings["settings.tempSel"].min if self._device.get("onOffStatus") == "0": self._attr_hvac_mode = HVACMode.OFF else: self._attr_hvac_mode = HON_HVAC_MODE[self._device.get("machMode") or "0"] - self._attr_fan_mode = HON_FAN[self._device.settings["settings.windSpeed"].value] + self._attr_fan_mode = HON_FAN[self._device.get("windSpeed")] - horizontal = self._device.settings["settings.windDirectionHorizontal"] - vertical = self._device.settings["settings.windDirectionVertical"] + horizontal = self._device.get("windDirectionHorizontal") + vertical = self._device.get("windDirectionVertical") if horizontal == "7" and vertical == "8": self._attr_swing_mode = SWING_BOTH elif horizontal == "7": @@ -159,3 +161,4 @@ class HonClimateEntity(HonEntity, ClimateEntity): self._attr_swing_mode = SWING_VERTICAL else: self._attr_swing_mode = SWING_OFF + self.async_write_ha_state() diff --git a/custom_components/hon/config_flow.py b/custom_components/hon/config_flow.py index e084ce9..468ba42 100644 --- a/custom_components/hon/config_flow.py +++ b/custom_components/hon/config_flow.py @@ -1,9 +1,9 @@ import logging import voluptuous as vol + from homeassistant import config_entries from homeassistant.const import CONF_EMAIL, CONF_PASSWORD - from .const import DOMAIN _LOGGER = logging.getLogger(__name__) diff --git a/custom_components/hon/const.py b/custom_components/hon/const.py index 03b73be..e441167 100644 --- a/custom_components/hon/const.py +++ b/custom_components/hon/const.py @@ -21,7 +21,7 @@ PLATFORMS = [ HON_HVAC_MODE = { "0": HVACMode.AUTO, "1": HVACMode.COOL, - "2": HVACMode.COOL, + "2": HVACMode.DRY, "3": HVACMode.DRY, "4": HVACMode.HEAT, "5": HVACMode.FAN_ONLY, diff --git a/custom_components/hon/hon.py b/custom_components/hon/hon.py index a446fb8..ea171db 100644 --- a/custom_components/hon/hon.py +++ b/custom_components/hon/hon.py @@ -1,11 +1,11 @@ import logging from datetime import timedelta +from pyhon.appliance import HonAppliance + from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from homeassistant.helpers.update_coordinator import DataUpdateCoordinator -from pyhon.appliance import HonAppliance - from .const import DOMAIN _LOGGER = logging.getLogger(__name__) diff --git a/custom_components/hon/select.py b/custom_components/hon/select.py index d769d3b..6f66cf4 100644 --- a/custom_components/hon/select.py +++ b/custom_components/hon/select.py @@ -108,7 +108,6 @@ SELECTS = { SelectEntityDescription( key="startProgram.program", name="Program", - entity_category=EntityCategory.CONFIG, translation_key="programs_ac", ), SelectEntityDescription( diff --git a/custom_components/hon/sensor.py b/custom_components/hon/sensor.py index 14956b6..72520d3 100644 --- a/custom_components/hon/sensor.py +++ b/custom_components/hon/sensor.py @@ -1,5 +1,7 @@ import logging +from pyhon import Hon + from homeassistant.components.sensor import ( SensorEntity, SensorDeviceClass, @@ -20,8 +22,6 @@ from homeassistant.const import ( from homeassistant.core import callback from homeassistant.helpers.entity import EntityCategory from homeassistant.helpers.typing import StateType -from pyhon import Hon - from . import const from .const import DOMAIN from .hon import HonCoordinator, HonEntity, unique_entities @@ -399,6 +399,72 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { options=list(const.DISHWASHER_PR_PHASE), ), ), + "AC": ( + SensorEntityDescription( + key="tempAirOutdoor", + name="Air Temperature Outdoor", + icon="mdi:thermometer", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + ), + SensorEntityDescription( + key="tempCoilerIndoor", + name="Coiler Temperature Indoor", + icon="mdi:thermometer", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + ), + SensorEntityDescription( + key="tempCoilerOutdoor", + name="Coiler Temperature Outside", + icon="mdi:thermometer", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + ), + SensorEntityDescription( + key="tempDefrostOutdoor", + name="Defrost Temperature Outdoor", + icon="mdi:thermometer", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + ), + SensorEntityDescription( + key="tempInAirOutdoor", + name="In Air Temperature Outdoor", + icon="mdi:thermometer", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + ), + SensorEntityDescription( + key="tempIndoor", + name="Indoor Temperature", + icon="mdi:thermometer", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + ), + SensorEntityDescription( + key="tempOutdoor", + name="Outdoor Temperature", + icon="mdi:thermometer", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + ), + SensorEntityDescription( + key="tempSel", + name="Selected Temperature", + icon="mdi:thermometer", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + ), + ), "REF": ( SensorEntityDescription( key="humidityEnv", diff --git a/custom_components/hon/switch.py b/custom_components/hon/switch.py index 5d58ef8..cf71aed 100644 --- a/custom_components/hon/switch.py +++ b/custom_components/hon/switch.py @@ -2,13 +2,14 @@ import logging from dataclasses import dataclass from typing import Any -from homeassistant.components.switch import SwitchEntityDescription, SwitchEntity -from homeassistant.config_entries import ConfigEntry -from homeassistant.const import EntityCategory from pyhon import Hon from pyhon.appliance import HonAppliance from pyhon.parameter.range import HonParameterRange +from homeassistant.components.switch import SwitchEntityDescription, SwitchEntity +from homeassistant.config_entries import ConfigEntry +from homeassistant.const import EntityCategory +from homeassistant.core import callback from .const import DOMAIN from .hon import HonCoordinator, HonEntity, unique_entities @@ -19,6 +20,7 @@ _LOGGER = logging.getLogger(__name__) class HonSwitchEntityDescriptionMixin: turn_on_key: str = "" turn_off_key: str = "" + status_key: str = "" @dataclass @@ -251,12 +253,14 @@ SWITCHES: dict[str, tuple[HonSwitchEntityDescription, ...]] = { "AC": ( HonSwitchEntityDescription( key="settings.10degreeHeatingStatus", + status_key="10degreeHeatingStatus", name="10° Heating", icon="mdi:heat-wave", translation_key="10_degree_heating", ), HonSwitchEntityDescription( key="settings.echoStatus", + status_key="echoStatus", name="Echo", icon="mdi:account-voice", ), @@ -267,23 +271,27 @@ SWITCHES: dict[str, tuple[HonSwitchEntityDescription, ...]] = { ), HonSwitchEntityDescription( key="settings.healthMode", + status_key="healthMode", name="Health Mode", icon="mdi:medication-outline", ), HonSwitchEntityDescription( key="settings.muteStatus", + status_key="muteStatus", name="Mute", icon="mdi:volume-off", translation_key="mute_mode", ), HonSwitchEntityDescription( key="settings.rapidMode", + status_key="rapidMode", name="Rapid Mode", icon="mdi:run-fast", translation_key="rapid_mode", ), HonSwitchEntityDescription( key="settings.screenDisplayStatus", + status_key="screenDisplayStatus", name="Screen Display", icon="mdi:monitor-small", ), @@ -295,12 +303,14 @@ SWITCHES: dict[str, tuple[HonSwitchEntityDescription, ...]] = { ), HonSwitchEntityDescription( key="settings.selfCleaningStatus", + status_key="selfCleaningStatus", name="Self Cleaning", icon="mdi:air-filter", translation_key="self_clean", ), HonSwitchEntityDescription( key="settings.silentSleepStatus", + status_key="silentSleepStatus", name="Silent Sleep", icon="mdi:bed", translation_key="silent_mode", @@ -392,6 +402,8 @@ class HonSwitchEntity(HonEntity, SwitchEntity): or hasattr(setting, "min") and setting.value != setting.min ) + elif self.entity_description.status_key: + return self._device.get(self.entity_description.status_key, "0") == "1" return self._device.get(self.entity_description.key, False) async def async_turn_on(self, **kwargs: Any) -> None: @@ -438,3 +450,11 @@ class HonSwitchEntity(HonEntity, SwitchEntity): and self._device.get("attributes.lastConnEvent.category") != "DISCONNECTED" ) + + @callback + def _handle_coordinator_update(self): + if not self.entity_description.status_key: + return + value = self._device.get(self.entity_description.status_key, "0") + self._attr_state = value == "1" + self.async_write_ha_state() diff --git a/custom_components/hon/translations/cs.json b/custom_components/hon/translations/cs.json index 45c7584..6e469fa 100644 --- a/custom_components/hon/translations/cs.json +++ b/custom_components/hon/translations/cs.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Otevřená dvířka Chladnička" + }, + "filter_replacement": { + "name": "Výměna filtru" } }, "number": { diff --git a/custom_components/hon/translations/de.json b/custom_components/hon/translations/de.json index 227cb6d..8ce7b77 100644 --- a/custom_components/hon/translations/de.json +++ b/custom_components/hon/translations/de.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Tür offen Kühlschrank" + }, + "filter_replacement": { + "name": "Filteraustausch" } }, "number": { diff --git a/custom_components/hon/translations/el.json b/custom_components/hon/translations/el.json index 43ae6ea..5eb9b50 100644 --- a/custom_components/hon/translations/el.json +++ b/custom_components/hon/translations/el.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Πόρτα ανοιχτή Ψυγείο" + }, + "filter_replacement": { + "name": "Αντικατάσταση φίλτρου" } }, "number": { diff --git a/custom_components/hon/translations/en.json b/custom_components/hon/translations/en.json index 632fd4d..cbb5df0 100644 --- a/custom_components/hon/translations/en.json +++ b/custom_components/hon/translations/en.json @@ -1323,6 +1323,9 @@ }, "fridge_door": { "name": "Door open Fridge" + }, + "filter_replacement": { + "name": "Filter replacement" } }, "number": { diff --git a/custom_components/hon/translations/es.json b/custom_components/hon/translations/es.json index 6a75256..fba0c2b 100644 --- a/custom_components/hon/translations/es.json +++ b/custom_components/hon/translations/es.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Puerta abierta Frigorífico" + }, + "filter_replacement": { + "name": "Sustitución del filtro" } }, "number": { diff --git a/custom_components/hon/translations/fr.json b/custom_components/hon/translations/fr.json index f296121..1370cd0 100644 --- a/custom_components/hon/translations/fr.json +++ b/custom_components/hon/translations/fr.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Porte ouverte Réfrigérateur" + }, + "filter_replacement": { + "name": "Remplacement du filtre" } }, "number": { diff --git a/custom_components/hon/translations/he.json b/custom_components/hon/translations/he.json index b4c1d85..84b8d8c 100644 --- a/custom_components/hon/translations/he.json +++ b/custom_components/hon/translations/he.json @@ -708,6 +708,9 @@ }, "fridge_door": { "name": "Door open Fridge" + }, + "filter_replacement": { + "name": "Filter replacement" } }, "number": { diff --git a/custom_components/hon/translations/hr.json b/custom_components/hon/translations/hr.json index 3bcaf38..cd3c594 100644 --- a/custom_components/hon/translations/hr.json +++ b/custom_components/hon/translations/hr.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Otvorena vrata Hladnjak" + }, + "filter_replacement": { + "name": "Zamjena filtra" } }, "number": { diff --git a/custom_components/hon/translations/it.json b/custom_components/hon/translations/it.json index 93d6a54..f90510f 100644 --- a/custom_components/hon/translations/it.json +++ b/custom_components/hon/translations/it.json @@ -1307,6 +1307,9 @@ }, "fridge_door": { "name": "Porta aperta Frigorifero" + }, + "filter_replacement": { + "name": "Sostituzione filtro" } }, "number": { diff --git a/custom_components/hon/translations/nl.json b/custom_components/hon/translations/nl.json index da1e42e..fbbf1c3 100644 --- a/custom_components/hon/translations/nl.json +++ b/custom_components/hon/translations/nl.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Deur open Koelkast" + }, + "filter_replacement": { + "name": "Filter vervangen" } }, "number": { diff --git a/custom_components/hon/translations/pl.json b/custom_components/hon/translations/pl.json index e709445..5a4dd32 100644 --- a/custom_components/hon/translations/pl.json +++ b/custom_components/hon/translations/pl.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Drzwi otwarte Lodówka" + }, + "filter_replacement": { + "name": "Wymiana filtra" } }, "number": { diff --git a/custom_components/hon/translations/pt.json b/custom_components/hon/translations/pt.json index 3bdd0a7..81e669f 100644 --- a/custom_components/hon/translations/pt.json +++ b/custom_components/hon/translations/pt.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Porta aberta Frigorífico" + }, + "filter_replacement": { + "name": "Substituição do filtro" } }, "number": { diff --git a/custom_components/hon/translations/ro.json b/custom_components/hon/translations/ro.json index af0b9a6..7ed2d58 100644 --- a/custom_components/hon/translations/ro.json +++ b/custom_components/hon/translations/ro.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Ușă deschisă Frigider" + }, + "filter_replacement": { + "name": "Înlocuirea filtrului" } }, "number": { diff --git a/custom_components/hon/translations/ru.json b/custom_components/hon/translations/ru.json index 78b9c58..b828f6b 100644 --- a/custom_components/hon/translations/ru.json +++ b/custom_components/hon/translations/ru.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Дверца открыта Холодильник" + }, + "filter_replacement": { + "name": "Замена фильтра" } }, "number": { diff --git a/custom_components/hon/translations/sk.json b/custom_components/hon/translations/sk.json index 584ad91..29d2542 100644 --- a/custom_components/hon/translations/sk.json +++ b/custom_components/hon/translations/sk.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Otvorené dvere Chladnička" + }, + "filter_replacement": { + "name": "Výmena filtra" } }, "number": { diff --git a/custom_components/hon/translations/sl.json b/custom_components/hon/translations/sl.json index 49369f3..bad6238 100644 --- a/custom_components/hon/translations/sl.json +++ b/custom_components/hon/translations/sl.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Door open Hladilnik" + }, + "filter_replacement": { + "name": "Menjava filtra" } }, "number": { diff --git a/custom_components/hon/translations/sr.json b/custom_components/hon/translations/sr.json index 527189a..84f3d08 100644 --- a/custom_components/hon/translations/sr.json +++ b/custom_components/hon/translations/sr.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Vrata su otvorena Frižider" + }, + "filter_replacement": { + "name": "Zamena filtera" } }, "number": { diff --git a/custom_components/hon/translations/tr.json b/custom_components/hon/translations/tr.json index f984169..ca30528 100644 --- a/custom_components/hon/translations/tr.json +++ b/custom_components/hon/translations/tr.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "Kapı açık Buzdolabı" + }, + "filter_replacement": { + "name": "Filtre değişimi" } }, "number": { diff --git a/custom_components/hon/translations/zh.json b/custom_components/hon/translations/zh.json index afc50dd..756c123 100644 --- a/custom_components/hon/translations/zh.json +++ b/custom_components/hon/translations/zh.json @@ -1255,6 +1255,9 @@ }, "fridge_door": { "name": "门打开 冰箱" + }, + "filter_replacement": { + "name": "更换过滤器" } }, "number": { diff --git a/scripts/generate_translation.py b/scripts/generate_translation.py index 08465ab..6c1bd79 100755 --- a/scripts/generate_translation.py +++ b/scripts/generate_translation.py @@ -112,6 +112,7 @@ NAMES = { "super_freeze": "REF_CMD&CTRL.MODALITIES.SUPER_FREEZE", "freezer_door": ["GLOBALS.APPLIANCE_STATUS.DOOR_OPEN", "REF.ZONES.FREEZER"], "fridge_door": ["GLOBALS.APPLIANCE_STATUS.DOOR_OPEN", "REF.ZONES.FRIDGE"], + "filter_replacement": "AP.MAINTENANCE.FILTER_REPLACEMENT", }, "button": { "induction_hob": "GLOBALS.APPLIANCES_NAME.IH", diff --git a/scripts/sensor_docs.py b/scripts/sensor_docs.py index f13345c..022027c 100755 --- a/scripts/sensor_docs.py +++ b/scripts/sensor_docs.py @@ -61,7 +61,9 @@ for entity_type, appliances in entities.items(): attributes = (key, entity.name, entity.icon, entity_type) category = ( "control" - if entity_type in ["switch", "button", "climate"] + if entity.key.startswith("settings") + or hasattr(entity, "turn_on_key") + or entity_type in ["button", "climate"] else "sensor" ) result.setdefault(appliance, {}).setdefault(