diff --git a/README.md b/README.md index 4aaa82f..6d2f970 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,14 @@ ## 目前支持的设备类型 - T0x26 浴霸 +- T0xA1 除湿机 - T0xAC 空调 - T0xB2 电蒸箱 - T0xB3 消毒碗柜 +- T0xB7 燃气灶 - T0xB8 智能扫地机器人 - T0xCA 对开门冰箱 +- T0xCC 中央空调(风管机)Wi-Fi线控器 - T0xCE 新风机 - T0xCF 中央空调暖家 - T0xD9 复式洗衣机 diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xA1.py b/custom_components/midea_auto_cloud/device_mapping/T0xA1.py new file mode 100644 index 0000000..3779c2d --- /dev/null +++ b/custom_components/midea_auto_cloud/device_mapping/T0xA1.py @@ -0,0 +1,91 @@ +from homeassistant.components.humidifier import HumidifierDeviceClass +from homeassistant.const import Platform, UnitOfTime +from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass +from homeassistant.components.binary_sensor import BinarySensorDeviceClass +from homeassistant.components.switch import SwitchDeviceClass + +DEVICE_MAPPING = { + "default": { + "rationale": ["off", "on"], + "queries": [{}], + "centralized": [], + "entities": { + Platform.SWITCH: { + "power": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "anion": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "child_lock": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "wind_swing_ud": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "filter_tip": { + "device_class": SwitchDeviceClass.SWITCH, + }, + }, + Platform.HUMIDIFIER: { + "dehumidifier": { + "device_class": HumidifierDeviceClass.HUMIDIFIER, + "power": "power", + "target_humidity": "humidity", + "current_humidity": "cur_humidity", + "min_humidity": 35, + "max_humidity": 85, + "mode": "mode", + "modes": { + "continuity": {"mode": "continuity"}, + "auto": {"mode": "auto"}, + "fan": {"mode": "fan"}, + "dry_shoes": {"mode": "dry_shoes"}, + "dry_clothes": {"mode": "dry_clothes"} + } + } + }, + Platform.BINARY_SENSOR: { + "tank_status": { + "device_class": BinarySensorDeviceClass.PROBLEM + } + }, + Platform.SELECT: { + "wind_speed": { + "options": { + "low": {"wind_speed": "30"}, + "high": {"wind_speed": "80"}, + } + }, + "power_on_time": { + "options": { + "off": {"power_on_timer": "off"}, + "15": {"power_on_timer": "on", "power_on_time_value": "15"}, + "30": {"power_on_timer": "on", "power_on_time_value": "30"}, + "45": {"power_on_timer": "on", "power_on_time_value": "45"}, + "60": {"power_on_timer": "on", "power_on_time_value": "60"}, + } + }, + "power_off_time": { + "options": { + "off": {"power_off_timer": "off"}, + "15": {"power_off_timer": "on", "power_off_time_value": "15"}, + "30": {"power_off_timer": "on", "power_off_time_value": "30"}, + "45": {"power_off_timer": "on", "power_off_time_value": "45"}, + "60": {"power_off_timer": "on", "power_off_time_value": "60"}, + } + }, + }, + Platform.SENSOR: { + "water_full_time": { + "device_class": SensorDeviceClass.DURATION, + "unit_of_measurement": UnitOfTime.MINUTES, + "state_class": SensorStateClass.MEASUREMENT + }, + "water_full_level": { + "device_class": SensorDeviceClass.ENUM + }, + } + } + } +} diff --git a/custom_components/midea_auto_cloud/translations/en.json b/custom_components/midea_auto_cloud/translations/en.json index 40bf42b..3454654 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -320,6 +320,9 @@ }, "standby_status": { "name": "Standby Status" + }, + "tank_status": { + "name": "Tank Status" } }, "climate": { @@ -345,6 +348,9 @@ "humidifier": { "humidifier": { "name": "Humidifier" + }, + "dehumidifier": { + "name": "Dehumidifier" } }, "select": { @@ -605,6 +611,12 @@ }, "air_set_hour": { "name": "Drying Storage Set Time" + }, + "power_on_time": { + "name": "Power On Time" + }, + "power_off_time": { + "name": "Power Off Time" } }, "sensor": { @@ -1462,9 +1474,27 @@ }, "hot_pot_temperature": { "name": "Hot Pot Temperature" + }, + "water_full_time": { + "name": "Water Full Time" + }, + "water_full_level": { + "name": "Water Full Level" } }, "switch": { + "anion": { + "name": "Anion" + }, + "child_lock": { + "name": "Child Lock" + }, + "wind_swing_ud": { + "name": "Wind Swing UD" + }, + "filter_tip": { + "name": "Filter Tip" + }, "control_status": { "name": "Start Pause" }, @@ -1954,12 +1984,6 @@ "power": { "name": "Power" }, - "power_off_timer": { - "name": "Power Off Timer" - }, - "power_on_timer": { - "name": "Power On Timer" - }, "power_state": { "name": "Power State" }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index 606ae5a..b51a981 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -320,6 +320,9 @@ }, "standby_status": { "name": "待机状态" + }, + "tank_status": { + "name": "水箱状态" } }, "climate": { @@ -345,6 +348,9 @@ "humidifier": { "humidifier": { "name": "加湿器" + }, + "dehumidifier": { + "name": "除湿器" } }, "select": { @@ -605,6 +611,12 @@ }, "air_set_hour": { "name": "烘干存储设置时间" + }, + "power_on_time": { + "name": "开机时间" + }, + "power_off_time": { + "name": "关机时间" } }, "sensor": { @@ -1462,9 +1474,27 @@ }, "hot_pot_temperature": { "name": "热水温度" + }, + "water_full_time": { + "name": "满水时间" + }, + "water_full_level": { + "name": "满水水位" } }, "switch": { + "anion": { + "name": "负离子" + }, + "child_lock": { + "name": "童锁" + }, + "wind_swing_ud": { + "name": "上下摆风" + }, + "filter_tip": { + "name": "除菌" + }, "add_water_flag": { "name": "加水标志" }, @@ -1954,12 +1984,6 @@ "power": { "name": "电源" }, - "power_off_timer": { - "name": "关机定时器" - }, - "power_on_timer": { - "name": "开机定时器" - }, "power_state": { "name": "电源状态" },