From 2d2d0de10a39b9b3b4c053b04f25cd3b8a73dbe2 Mon Sep 17 00:00:00 2001 From: sususweet Date: Fri, 10 Oct 2025 09:42:51 +0800 Subject: [PATCH] fix: update translation and entity for T0xE1 --- .../midea_auto_cloud/device_mapping/T0xE1.py | 29 ++++++++++--------- .../midea_auto_cloud/translations/en.json | 24 +++++++-------- .../translations/zh-Hans.json | 26 ++++++++--------- 3 files changed, 40 insertions(+), 39 deletions(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xE1.py b/custom_components/midea_auto_cloud/device_mapping/T0xE1.py index 8bba27e..f7ef584 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xE1.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xE1.py @@ -19,9 +19,6 @@ DEVICE_MAPPING = { "uvswitch": { "device_class": SwitchDeviceClass.SWITCH, }, - "doorswitch": { - "device_class": SwitchDeviceClass.SWITCH, - }, "dryswitch": { "device_class": SwitchDeviceClass.SWITCH, }, @@ -30,6 +27,9 @@ DEVICE_MAPPING = { } }, Platform.BINARY_SENSOR: { + "doorswitch": { + "device_class": BinarySensorDeviceClass.RUNNING, + }, "air_status": { "device_class": BinarySensorDeviceClass.RUNNING, }, @@ -59,6 +59,16 @@ DEVICE_MAPPING = { }, }, Platform.SELECT: { + "air_set_hour": { + "options": { + "12": {"air_set_hour": "12" }, + "24": {"air_set_hour": "24" }, + "36": {"air_set_hour": "36" }, + "48": {"air_set_hour": "48" }, + "60": {"air_set_hour": "60" }, + "72": {"air_set_hour": "72" }, + } + }, "work_status": { "options": { "power_off": {"work_status": "power_off" }, @@ -96,9 +106,7 @@ DEVICE_MAPPING = { }, Platform.SENSOR: { "bright": { - "device_class": SensorDeviceClass.ILLUMINANCE, - "unit_of_measurement": "lx", - "state_class": SensorStateClass.MEASUREMENT + "device_class": SensorDeviceClass.ENUM }, "temperature": { "device_class": SensorDeviceClass.TEMPERATURE, @@ -106,20 +114,13 @@ DEVICE_MAPPING = { "state_class": SensorStateClass.MEASUREMENT }, "softwater": { - "device_class": SensorDeviceClass.TEMPERATURE, - "unit_of_measurement": UnitOfTemperature.CELSIUS, - "state_class": SensorStateClass.MEASUREMENT + "device_class": SensorDeviceClass.ENUM }, "left_time": { "device_class": SensorDeviceClass.DURATION, "unit_of_measurement": UnitOfTime.MINUTES, "state_class": SensorStateClass.MEASUREMENT }, - "air_set_hour": { - "device_class": SensorDeviceClass.DURATION, - "unit_of_measurement": UnitOfTime.HOURS, - "state_class": SensorStateClass.MEASUREMENT - }, "air_left_hour": { "device_class": SensorDeviceClass.DURATION, "unit_of_measurement": UnitOfTime.HOURS, diff --git a/custom_components/midea_auto_cloud/translations/en.json b/custom_components/midea_auto_cloud/translations/en.json index 950ba54..40bf42b 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -123,6 +123,9 @@ }, "entity": { "binary_sensor": { + "doorswitch": { + "name": "Door Switch" + }, "softener_lack": { "name": "Softener Lack" }, @@ -145,7 +148,7 @@ "name": "Bottom Hot" }, "bright_lack": { - "name": "Brightness Lack" + "name": "Brightener Lack" }, "carpet_switch": { "name": "Carpet Switch" @@ -208,7 +211,7 @@ "name": "RTC Error" }, "softwater_lack": { - "name": "Soft Water Lack" + "name": "Lack of Soft Water Salt" }, "storage_door_state": { "name": "Storage Door State" @@ -599,6 +602,9 @@ }, "drying_direction": { "name": "Drying Direction" + }, + "air_set_hour": { + "name": "Drying Storage Set Time" } }, "sensor": { @@ -624,10 +630,7 @@ "name": "Air Dry Left Time" }, "air_left_hour": { - "name": "AC Remaining Time" - }, - "air_set_hour": { - "name": "AC Set Time" + "name": "Drying Storage Remaining Time" }, "appointment_time": { "name": "Appointment Time" @@ -657,7 +660,7 @@ "name": "Bottom Temperature" }, "bright": { - "name": "Brightness" + "name": "Brightener Level" }, "category": { "name": "Category" @@ -1074,7 +1077,7 @@ "name": "Softener Global" }, "softwater": { - "name": "Soft Water Temp" + "name": "Soft Water Level" }, "station_error_desc": { "name": "Station Error Description" @@ -1649,7 +1652,7 @@ "name": "Air Dry On Off" }, "airswitch": { - "name": "AC Switch" + "name": "Drying Storage Switch" }, "appointment": { "name": "Appointment" @@ -1771,9 +1774,6 @@ "door_warn": { "name": "Door Warning" }, - "doorswitch": { - "name": "Door Switch" - }, "down_light": { "name": "Down Light" }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index f1b8ebd..606ae5a 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -123,6 +123,9 @@ }, "entity": { "binary_sensor": { + "doorswitch": { + "name": "门锁开关" + }, "air_status": { "name": "空气运行" }, @@ -133,7 +136,7 @@ "name": "底部加热" }, "bright_lack": { - "name": "亮光不足" + "name": "亮光剂不足" }, "carpet_switch": { "name": "地毯开关" @@ -196,7 +199,7 @@ "name": "RTC 错误" }, "softwater_lack": { - "name": "软水不足" + "name": "软水盐不足" }, "storage_door_state": { "name": "冷藏门状态" @@ -599,6 +602,9 @@ }, "drying_direction": { "name": "烘干方向" + }, + "air_set_hour": { + "name": "烘干存储设置时间" } }, "sensor": { @@ -624,10 +630,7 @@ "name": "风干剩余时间" }, "air_left_hour": { - "name": "空调剩余时间" - }, - "air_set_hour": { - "name": "空调设置时间" + "name": "烘干存储剩余时间" }, "appointment_time": { "name": "预约时间" @@ -657,7 +660,7 @@ "name": "底部温度" }, "bright": { - "name": "亮度" + "name": "亮光剂档位" }, "category": { "name": "类别" @@ -1074,7 +1077,7 @@ "name": "柔顺剂全局" }, "softwater": { - "name": "软水温度" + "name": "软水盐档位" }, "station_error_desc": { "name": "基站错误描述" @@ -1649,7 +1652,7 @@ "name": "风干开关" }, "airswitch": { - "name": "空调开关" + "name": "烘干存储开关" }, "appointment": { "name": "预约" @@ -1771,9 +1774,6 @@ "door_warn": { "name": "门警告" }, - "doorswitch": { - "name": "门锁开关" - }, "down_light": { "name": "下灯" }, @@ -1796,7 +1796,7 @@ "name": "烘干通道过热" }, "dryswitch": { - "name": "烘干开关" + "name": "晶焰烘干开关" }, "easy_ironing": { "name": "易熨烫"