From f56d058443c1f044bad96d3ee2128903afd57dd1 Mon Sep 17 00:00:00 2001 From: LG-ThinQ-Integration Date: Thu, 6 Feb 2025 19:39:58 +0900 Subject: [PATCH] Add switch to LG ThinQ for power control (#137512) Add switch for convenient power control Co-authored-by: yunseon.park --- homeassistant/components/lg_thinq/icons.json | 8 ++++++- .../components/lg_thinq/strings.json | 10 ++++++-- homeassistant/components/lg_thinq/switch.py | 24 +++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/lg_thinq/icons.json b/homeassistant/components/lg_thinq/icons.json index 87cf04e0c1a..42ae5746f24 100644 --- a/homeassistant/components/lg_thinq/icons.json +++ b/homeassistant/components/lg_thinq/icons.json @@ -7,8 +7,11 @@ "express_mode": { "default": "mdi:snowflake-variant" }, + "express_fridge": { + "default": "mdi:snowflake" + }, "hot_water_mode": { - "default": "mdi:list-status" + "default": "mdi:heat-wave" }, "humidity_warm_mode": { "default": "mdi:heat-wave" @@ -39,6 +42,9 @@ }, "warm_mode": { "default": "mdi:heat-wave" + }, + "display_light": { + "default": "mdi:lightbulb-on-outline" } }, "binary_sensor": { diff --git a/homeassistant/components/lg_thinq/strings.json b/homeassistant/components/lg_thinq/strings.json index a776dde2054..8f498e0f8a2 100644 --- a/homeassistant/components/lg_thinq/strings.json +++ b/homeassistant/components/lg_thinq/strings.json @@ -30,10 +30,13 @@ "name": "Auto mode" }, "express_mode": { - "name": "Ice plus" + "name": "Express mode" + }, + "express_fridge": { + "name": "Express cool" }, "hot_water_mode": { - "name": "Hot water" + "name": "Heating water" }, "humidity_warm_mode": { "name": "Warm mist" @@ -64,6 +67,9 @@ }, "warm_mode": { "name": "Heating" + }, + "display_light": { + "name": "Lighting" } }, "binary_sensor": { diff --git a/homeassistant/components/lg_thinq/switch.py b/homeassistant/components/lg_thinq/switch.py index 25fd7eb8b64..6d69ce9a314 100644 --- a/homeassistant/components/lg_thinq/switch.py +++ b/homeassistant/components/lg_thinq/switch.py @@ -33,6 +33,18 @@ class ThinQSwitchEntityDescription(SwitchEntityDescription): DEVICE_TYPE_SWITCH_MAP: dict[DeviceType, tuple[ThinQSwitchEntityDescription, ...]] = { DeviceType.AIR_CONDITIONER: ( + ThinQSwitchEntityDescription( + key=ThinQProperty.AIR_CON_OPERATION_MODE, + translation_key="operation_power", + entity_category=EntityCategory.CONFIG, + ), + ThinQSwitchEntityDescription( + key=ThinQProperty.DISPLAY_LIGHT, + translation_key=ThinQProperty.DISPLAY_LIGHT, + on_key="on", + off_key="off", + entity_category=EntityCategory.CONFIG, + ), ThinQSwitchEntityDescription( key=ThinQProperty.POWER_SAVE_ENABLED, translation_key=ThinQProperty.POWER_SAVE_ENABLED, @@ -121,8 +133,20 @@ DEVICE_TYPE_SWITCH_MAP: dict[DeviceType, tuple[ThinQSwitchEntityDescription, ... off_key="false", entity_category=EntityCategory.CONFIG, ), + ThinQSwitchEntityDescription( + key=ThinQProperty.EXPRESS_FRIDGE, + translation_key=ThinQProperty.EXPRESS_FRIDGE, + on_key="true", + off_key="false", + entity_category=EntityCategory.CONFIG, + ), ), DeviceType.SYSTEM_BOILER: ( + ThinQSwitchEntityDescription( + key=ThinQProperty.BOILER_OPERATION_MODE, + translation_key="operation_power", + entity_category=EntityCategory.CONFIG, + ), ThinQSwitchEntityDescription( key=ThinQProperty.HOT_WATER_MODE, translation_key=ThinQProperty.HOT_WATER_MODE,