From 5ffa57bed8f05e57c063513174bd52a7177ddcd0 Mon Sep 17 00:00:00 2001 From: sususweet Date: Fri, 10 Oct 2025 20:45:24 +0800 Subject: [PATCH] feat: update device mapping for T0xCA. --- .../midea_auto_cloud/config_flow.py | 4 +-- .../midea_auto_cloud/device_mapping/T0xCA.py | 27 ++++++++----------- .../midea_auto_cloud/translations/en.json | 9 ++++--- .../translations/zh-Hans.json | 9 ++++--- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/custom_components/midea_auto_cloud/config_flow.py b/custom_components/midea_auto_cloud/config_flow.py index 935b291..eceec33 100644 --- a/custom_components/midea_auto_cloud/config_flow.py +++ b/custom_components/midea_auto_cloud/config_flow.py @@ -44,9 +44,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): ) try: if await cloud.login(): - await self.async_set_unique_id(user_input[CONF_ACCOUNT]) - self._abort_if_unique_id_configured() - + # 保存云实例和用户输入,用于后续步骤 self._cloud = cloud self._user_input = user_input diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xCA.py b/custom_components/midea_auto_cloud/device_mapping/T0xCA.py index b057109..3afc3e9 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xCA.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xCA.py @@ -11,7 +11,7 @@ DEVICE_MAPPING = { "freezing_mode", "intelligent_mode", "energy_saving_mode", "holiday_mode", "moisturize_mode", "preservation_mode", "acme_freezing_mode", "variable_mode", "storage_power", "left_flexzone_power", "right_flexzone_power", "freezing_power", - "function_zone_power", "storage_temperature", "freezing_temperature", + "storage_temperature", "freezing_temperature", "left_flexzone_temperature", "right_flexzone_temperature" ], "entities": { @@ -49,9 +49,6 @@ DEVICE_MAPPING = { "freezing_power": { "device_class": SwitchDeviceClass.SWITCH, }, - "function_zone_power": { - "device_class": SwitchDeviceClass.SWITCH, - }, "cross_peak_electricity": { "device_class": SwitchDeviceClass.SWITCH, }, @@ -192,26 +189,27 @@ DEVICE_MAPPING = { "variable_mode": { "options": { "none_mode": {"variable_mode": "none_mode"}, - "freezing": {"variable_mode": "freezing"}, - "refrigeration": {"variable_mode": "refrigeration"}, - "wine": {"variable_mode": "wine"}, - "vegetable": {"variable_mode": "vegetable"} + "soft_freezing_mode": {"variable_mode": "soft_freezing_mode"}, + "zero_fresh_mode": {"variable_mode": "zero_fresh_mode"}, + "cold_drink_mode": {"variable_mode": "cold_drink_mode"}, + "fresh_product_mode": {"variable_mode": "fresh_product_mode"}, + "partial_freezing_mode": {"variable_mode": "partial_freezing_mode"}, + "dry_zone_mode": {"variable_mode": "dry_zone_mode"}, + "freeze_warm_mode": {"variable_mode": "freeze_warm_mode"}, + "freeze_mode": {"variable_mode": "freeze_mode"}, } }, "icea_bar_function_switch": { "options": { "default": {"icea_bar_function_switch": "default"}, - "ice": {"icea_bar_function_switch": "ice"}, - "water": {"icea_bar_function_switch": "water"}, - "off": {"icea_bar_function_switch": "off"} + "refrigeration": {"icea_bar_function_switch": "refrigeration"}, + "freezing": {"icea_bar_function_switch": "freezing"}, } }, "food_site": { "options": { "left_freezing_room": {"food_site": "left_freezing_room"}, "right_freezing_room": {"food_site": "right_freezing_room"}, - "storage_room": {"food_site": "storage_room"}, - "function_zone": {"food_site": "function_zone"} } }, "temperature_unit": { @@ -222,9 +220,6 @@ DEVICE_MAPPING = { } }, Platform.SENSOR: { - "mode": { - "device_class": SensorDeviceClass.ENUM, - }, "storage_temperature": { "device_class": SensorDeviceClass.TEMPERATURE, "unit_of_measurement": UnitOfTemperature.CELSIUS, diff --git a/custom_components/midea_auto_cloud/translations/en.json b/custom_components/midea_auto_cloud/translations/en.json index 6c9ab57..fe6fc74 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -366,6 +366,9 @@ "control_type": { "name": "Control Type" }, + "dehydration_speed": { + "name": "Dehydration Speed" + }, "db_dehydration_speed": { "name": "DB Dehydration Speed" }, @@ -390,6 +393,9 @@ "db_temperature": { "name": "DB Temperature" }, + "water_level": { + "name": "Water Level" + }, "db_water_level": { "name": "DB Water Level" }, @@ -794,9 +800,6 @@ "db_wash_time": { "name": "DB Wash Time" }, - "dehydration_speed": { - "name": "Dehydration Speed" - }, "dehydration_time": { "name": "Dehydration Time" }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index 8e0fa34..0a26452 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -366,6 +366,9 @@ "control_type": { "name": "控制类型" }, + "dehydration_speed": { + "name": "脱水转速" + }, "db_dehydration_speed": { "name": "脱水转速" }, @@ -390,6 +393,9 @@ "db_temperature": { "name": "温度" }, + "water_level": { + "name": "水位" + }, "db_water_level": { "name": "水位" }, @@ -794,9 +800,6 @@ "db_wash_time": { "name": "洗涤时间" }, - "dehydration_speed": { - "name": "脱水转速" - }, "dehydration_time": { "name": "脱水时间" },