From ca1953ba460a8e2237108825312ed8d4f5bdb9be Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Sun, 28 Dec 2025 11:31:51 +0800 Subject: [PATCH] fix: Add correct power switch and control status entities for T0xD9 * Note: `power` is the washing machine's power switch, `db_running_status` only displays the running status of the current drum, `db_control_status` is the switch to start or pause the current drum. --- .../midea_auto_cloud/device_mapping/T0xD9.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xD9.py b/custom_components/midea_auto_cloud/device_mapping/T0xD9.py index d98bbb5..1996109 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xD9.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xD9.py @@ -24,6 +24,14 @@ DEVICE_MAPPING = { }, }, Platform.SWITCH: { + "db_power": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "db_control_status": { + "device_class": SwitchDeviceClass.SWITCH, + "rationale": ["pause", "start"], + "translation_key": "control_status", + } }, Platform.SELECT: { "db_location_selection": { @@ -32,17 +40,6 @@ DEVICE_MAPPING = { "right": {"db_location_selection": "right"} } }, - "db_running_status": { - "options": { - "off": {"db_power": "off", "db_running_status": "off"}, - "standby": {"db_power": "on", "db_running_status": "standby"}, - "start": {"db_power": "on", "db_running_status": "start"}, - "pause": {"db_power": "on", "db_running_status": "pause"}, - "end": {"db_power": "on", "db_running_status": "end"}, - "fault": {"db_power": "on", "db_running_status": "fault"}, - "delay": {"db_power": "on", "db_running_status": "delay"} - } - }, "db_program": { "options": { "baby_clothes": {"db_program": "baby_clothes"},