From bb700dd2f75a617025f93c15139a416e32160ef5 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Mon, 10 Jul 2023 00:20:35 +0200 Subject: [PATCH] Fix steam level --- custom_components/hon/number.py | 6 ------ custom_components/hon/select.py | 7 +++++++ custom_components/hon/sensor.py | 24 ++++++++---------------- scripts/translation_keys.py | 3 ++- 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/custom_components/hon/number.py b/custom_components/hon/number.py index fc8d61b..a04178b 100644 --- a/custom_components/hon/number.py +++ b/custom_components/hon/number.py @@ -48,12 +48,6 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = { native_unit_of_measurement=UnitOfTime.MINUTES, translation_key="wash_time", ), - HonConfigNumberEntityDescription( - key="startProgram.steamLevel", - name="Steam Level", - icon="mdi:weather-dust", - translation_key="steam_level", - ), HonConfigNumberEntityDescription( key="startProgram.waterHard", name="Water hard", diff --git a/custom_components/hon/select.py b/custom_components/hon/select.py index 7aba016..d86c9e7 100644 --- a/custom_components/hon/select.py +++ b/custom_components/hon/select.py @@ -49,6 +49,13 @@ SELECTS = { name="Program", translation_key="programs_wm", ), + HonConfigSelectEntityDescription( + key="startProgram.steamLevel", + name="Steam level", + icon="mdi:weather-dust", + translation_key="steam_level", + option_list=const.STEAM_LEVEL, + ), ), "TD": ( HonConfigSelectEntityDescription( diff --git a/custom_components/hon/sensor.py b/custom_components/hon/sensor.py index 668fb0b..89e9e47 100644 --- a/custom_components/hon/sensor.py +++ b/custom_components/hon/sensor.py @@ -186,6 +186,14 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { device_class=SensorDeviceClass.ENUM, translation_key="programs_wm", ), + HonSensorEntityDescription( + key="steamLevel", + name="Steam level", + icon="mdi:weather-dust", + device_class=SensorDeviceClass.ENUM, + translation_key="steam_level", + option_list=const.STEAM_LEVEL, + ), ), "TD": ( HonSensorEntityDescription( @@ -259,22 +267,6 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { state_class=SensorStateClass.MEASUREMENT, translation_key="energy_label", ), - HonConfigSensorEntityDescription( - key="startProgram.steamLevel", - name="Steam level", - device_class=SensorDeviceClass.ENUM, - icon="mdi:smoke", - translation_key="steam_level", - option_list=const.STEAM_LEVEL, - ), - HonSensorEntityDescription( - key="steamLevel", - name="Steam level", - icon="mdi:smoke", - device_class=SensorDeviceClass.ENUM, - translation_key="steam_level", - option_list=const.STEAM_LEVEL, - ), HonConfigSensorEntityDescription( key="steamType", name="Steam Type", diff --git a/scripts/translation_keys.py b/scripts/translation_keys.py index 013e69c..8f29d34 100644 --- a/scripts/translation_keys.py +++ b/scripts/translation_keys.py @@ -290,6 +290,7 @@ NAMES = { "ref_zones": "IH.COMMON.COIL", "diffuser": "AP.TITLES.DIFFUSER", "mode": "CUBE90_GLOBAL.GENERAL.MODE", + "steam_level": "WASHING_CMD&CTRL.PROGRAM_CYCLE_DETAIL_MAIN_OPTIONS.STEAM_LEVEL", }, "sensor": { "dry_levels": "WASHING_CMD&CTRL.DRAWER_CYCLE_DRYING.TAB_LEVEL", @@ -302,7 +303,7 @@ NAMES = { "duration": "WASHING_CMD&CTRL.DRAWER_PROGRAM_FILTERS.DURATION", "target_temperature": "IH.COOKING_DETAIL.TEMPERATURE_TARGETING", "spin_speed": "WASHING_CMD&CTRL.PROGRAM_CYCLE_DETAIL_MAIN_OPTIONS.SPINSPEED", - "steam_leve": "WASHING_CMD&CTRL.PROGRAM_CYCLE_DETAIL_MAIN_OPTIONS.STEAM_LEVEL", + "steam_level": "WASHING_CMD&CTRL.PROGRAM_CYCLE_DETAIL_MAIN_OPTIONS.STEAM_LEVEL", "dirt_level": "WASHING_CMD&CTRL.PROGRAM_CYCLE_DETAIL_MAIN_OPTIONS.DIRTY_LEVEL", "program_phases_wm": "WASHING_CMD&CTRL.STATISTICS_GRAPHIC_INSTANT_CONSUMPTION.PHASE", "program_phases_td": "WASHING_CMD&CTRL.STATISTICS_GRAPHIC_INSTANT_CONSUMPTION.PHASE",