From d19036f0dbc1153d7505bb5fcabb70d874545206 Mon Sep 17 00:00:00 2001 From: Yang Cyborg Date: Thu, 15 Jan 2026 20:24:15 +0800 Subject: [PATCH 1/5] fix: correct voltage device class to battery for T0xBC --- custom_components/midea_auto_cloud/device_mapping/T0xBC.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xBC.py b/custom_components/midea_auto_cloud/device_mapping/T0xBC.py index f95041e..28fc3bf 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xBC.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xBC.py @@ -47,9 +47,10 @@ DEVICE_MAPPING = { "attribute": "pm25" }, "voltage": { - "device_class": SensorDeviceClass.VOLTAGE, - "unit_of_measurement": UnitOfElectricPotential.VOLT, - "state_class": SensorStateClass.MEASUREMENT + "device_class": SensorDeviceClass.BATTERY, + "unit_of_measurement": "%", + "state_class": SensorStateClass.MEASUREMENT, + "translation_key": "battery_level" }, } } From 9f6cf15763b04fb38fbf888ee6fe58eda05b5e6e Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Fri, 16 Jan 2026 21:43:46 +0800 Subject: [PATCH 2/5] fix: support of wind_pressure sensor for T0xB6(730007H8) * also update translation_key --- .../midea_auto_cloud/device_mapping/T0xB6.py | 8 +++++++- custom_components/midea_auto_cloud/translations/en.json | 6 ++++++ .../midea_auto_cloud/translations/zh-Hans.json | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xB6.py b/custom_components/midea_auto_cloud/device_mapping/T0xB6.py index 0ed56b0..e4a4ad1 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xB6.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xB6.py @@ -1,5 +1,5 @@ from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass -from homeassistant.const import Platform, PERCENTAGE, UnitOfTime, UnitOfElectricPotential +from homeassistant.const import Platform, PERCENTAGE, UnitOfPressure, UnitOfTime, UnitOfElectricPotential from homeassistant.components.switch import SwitchDeviceClass DEVICE_MAPPING = { @@ -137,6 +137,12 @@ DEVICE_MAPPING = { "device_class": SensorDeviceClass.ENERGY, "unit_of_measurement": "kWh", "state_class": SensorStateClass.TOTAL_INCREASING, + "translation_key": "total_elec_value" + }, + "wind_pressure": { + "device_class": SensorDeviceClass.PRESSURE, + "unit_of_measurement": UnitOfPressure.PA, + "state_class": SensorStateClass.MEASUREMENT } }, Platform.BUTTON: { diff --git a/custom_components/midea_auto_cloud/translations/en.json b/custom_components/midea_auto_cloud/translations/en.json index b58da72..d809f64 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -1098,6 +1098,12 @@ } }, "sensor": { + "total_working_time": { + "name": "Total Working Time" + }, + "wind_pressure": { + "name": "Wind Pressure" + }, "tips_code": { "name": "Tips Code" }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index 2ca84a3..937ffaf 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -1334,6 +1334,12 @@ } }, "sensor": { + "total_working_time": { + "name": "累计工作时间" + }, + "wind_pressure": { + "name": "风压" + }, "tips_code": { "name": "提示代码" }, From 1f0b914d4de278669b7a56595e650961fd33aaa9 Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Fri, 16 Jan 2026 22:08:02 +0800 Subject: [PATCH 3/5] fix: add PM2.5 threshold settings support for T0xFC(571Z3081) --- .../midea_auto_cloud/device_mapping/T0xFC.py | 12 ++++++++++++ .../midea_auto_cloud/translations/en.json | 6 ++++++ .../midea_auto_cloud/translations/zh-Hans.json | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xFC.py b/custom_components/midea_auto_cloud/device_mapping/T0xFC.py index d311151..4975e80 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xFC.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xFC.py @@ -105,6 +105,18 @@ DEVICE_MAPPING = { "queries": [{}], "centralized": [], "entities": { + Platform.NUMBER: { + "hosting_upper": { + "min": 10, + "max": 75, + "step": 1 + }, + "hosting_lower": { + "min": 10, + "max": 75, + "step": 1 + } + }, Platform.SWITCH: { "power": { "device_class": SwitchDeviceClass.SWITCH, diff --git a/custom_components/midea_auto_cloud/translations/en.json b/custom_components/midea_auto_cloud/translations/en.json index d809f64..2f1e2df 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -2156,6 +2156,12 @@ } }, "number": { + "hosting_upper": { + "name": "PM2.5 Upper(Auto Purification)" + }, + "hosting_lower": { + "name": "PM2.5 Lower(Stop Purification)" + }, "steam_quantity": { "name": "Steam Quantity" }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index 937ffaf..4174bfd 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -2450,6 +2450,12 @@ } }, "number": { + "hosting_upper": { + "name": "PM2.5上阈值(自动净化)" + }, + "hosting_lower": { + "name": "PM2.5下阈值(停止净化)" + }, "steam_quantity": { "name": "蒸汽量" }, From 07c8fd32f028fcdb66b1bfaeb11b598d4354b261 Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Sun, 18 Jan 2026 20:02:46 +0800 Subject: [PATCH 4/5] fix: Use correct rationale values for T0xD9 child_lock switch --- custom_components/midea_auto_cloud/device_mapping/T0xD9.py | 1 + 1 file changed, 1 insertion(+) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xD9.py b/custom_components/midea_auto_cloud/device_mapping/T0xD9.py index daa87b4..d9be0a7 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xD9.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xD9.py @@ -43,6 +43,7 @@ DEVICE_MAPPING = { }, "db_baby_lock": { "device_class": SwitchDeviceClass.SWITCH, + "rationale": [0, 1], "translation_key": "child_lock", } }, From 023243297b1c94f5e386e1cc842dd7a7057536b8 Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Sun, 18 Jan 2026 23:30:38 +0800 Subject: [PATCH 5/5] fix: Correct return type from string to number for T0xD9 --- .../midea_auto_cloud/device_mapping/T0xD9.py | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xD9.py b/custom_components/midea_auto_cloud/device_mapping/T0xD9.py index d9be0a7..0c3a39c 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xD9.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xD9.py @@ -57,70 +57,70 @@ DEVICE_MAPPING = { "db_program": { "options": { "baby_clothes": {"db_program": "baby_clothes"}, - "baby_clothes_dry": {"db_program": "151"}, + "baby_clothes_dry": {"db_program": 151}, "clean_stains": {"db_program": "clean_stains"}, "cold_wash": {"db_program": "cold_wash"}, "cook_wash": {"db_program": "cook_wash"}, - "fast_wash": {"db_program": "137"}, - "hot_wind_dry": {"db_program": "153"}, + "fast_wash": {"db_program": 137}, + "hot_wind_dry": {"db_program": 153}, "rinsing_dehydration": {"db_program": "rinsing_dehydration"}, "self_wash_5": {"db_program": "self_wash_5"}, "single_dehytration": {"db_program": "single_dehytration"}, "single_drying": {"db_program": "single_drying"}, - "small_wash_dry": {"db_program": "138"}, - "socks": {"db_program": "148"}, + "small_wash_dry": {"db_program": 138}, + "socks": {"db_program": 148}, "standard": {"db_program": "standard"}, - "underpants": {"db_program": "156"}, + "underpants": {"db_program": 156}, "underwear": {"db_program": "underwear"}, "water_ssp": {"db_program": "water_ssp"} } }, "db_temperature": { "options": { - "冷水": {"db_temperature": "0"}, - "30℃": {"db_temperature": "3"}, - "40℃": {"db_temperature": "4"}, - "60℃": {"db_temperature": "5"}, - "95℃": {"db_temperature": "6"} + "冷水": {"db_temperature": 0}, + "30℃": {"db_temperature": 3}, + "40℃": {"db_temperature": 4}, + "60℃": {"db_temperature": 5}, + "95℃": {"db_temperature": 6} }, "translation_key": "temperature" }, "db_detergent": { "options": { - "关闭": {"db_detergent": "0"}, - "L1": {"db_detergent": "1"}, - "L2": {"db_detergent": "2"}, - "L3": {"db_detergent": "3"} + "关闭": {"db_detergent": 0}, + "L1": {"db_detergent": 1}, + "L2": {"db_detergent": 2}, + "L3": {"db_detergent": 3} }, "translation_key": "detergent" }, "db_dehydration_speed": { "options": { - "免脱水": {"db_dehydration_speed": "0"}, - "800转": {"db_dehydration_speed": "3"}, - "1000转": {"db_dehydration_speed": "4"} + "免脱水": {"db_dehydration_speed": 0}, + "800转": {"db_dehydration_speed": 3}, + "1000转": {"db_dehydration_speed": 4} }, "translation_key": "dehydration_speed" }, "db_rinse_count": { "options": { - "1次": {"db_rinse_count": "1"}, - "2次": {"db_rinse_count": "2"}, - "3次": {"db_rinse_count": "3"}, - "4次": {"db_rinse_count": "4"}, - "5次": {"db_rinse_count": "5"} + "1次": {"db_rinse_count": 1}, + "2次": {"db_rinse_count": 2}, + "3次": {"db_rinse_count": 3}, + "4次": {"db_rinse_count": 4}, + "5次": {"db_rinse_count": 5} }, "translation_key": "soak_count" }, "db_dry": { "options": { - "关闭": {"db_dry": "0"}, - "智能": {"db_dry": "1"}, - "定时240": {"db_dry": "12"}, - "定时180": {"db_dry": "11"}, - "定时120": {"db_dry": "7"}, - "定时60": {"db_dry": "5"}, - "定时30": {"db_dry": "4"} + "关闭": {"db_dry": 0}, + "智能": {"db_dry": 1}, + "定时240": {"db_dry": 12}, + "定时180": {"db_dry": 11}, + "定时120": {"db_dry": 7}, + "定时60": {"db_dry": 5}, + "定时30": {"db_dry": 4} } } },