feat: update device support for T0x26

This commit is contained in:
sususweet
2025-10-05 00:09:15 +08:00
parent 1f555800f3
commit 324ed37de4
4 changed files with 4713 additions and 4395 deletions

View File

@@ -15,6 +15,7 @@
## 目前支持的设备类型 ## 目前支持的设备类型
- T0x26 浴霸
- T0xAC 空调 - T0xAC 空调
- T0xB2 电蒸箱 - T0xB2 电蒸箱
- T0xB3 消毒碗柜 - T0xB3 消毒碗柜

View File

@@ -0,0 +1,148 @@
from homeassistant.const import Platform, UnitOfTemperature, PRECISION_HALVES, 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": [
"blowing_direction", "function_led_enable", "smelly_trigger", "subpacket_type",
"heating_direction", "light_mode", "drying_time", "wifi_led_enable", "mode",
"night_light_brightness", "bath_heating_time", "bath_direction", "delay_enable",
"main_light_brightness", "current_temperature", "digit_led_enable", "version",
"dehumidity_trigger", "delay_time", "bath_temperature", "blowing_speed"
],
"entities": {
Platform.SWITCH: {
"function_led_enable": {
"device_class": SwitchDeviceClass.SWITCH,
},
"smelly_trigger": {
"device_class": SwitchDeviceClass.SWITCH,
},
"wifi_led_enable": {
"device_class": SwitchDeviceClass.SWITCH,
},
"delay_enable": {
"device_class": SwitchDeviceClass.SWITCH,
},
"digit_led_enable": {
"device_class": SwitchDeviceClass.SWITCH,
},
"dehumidity_trigger": {
"device_class": SwitchDeviceClass.SWITCH,
}
},
Platform.SELECT: {
"blowing_direction": {
"options": {
"0": {"blowing_direction": 0},
"45": {"blowing_direction": 45},
"90": {"blowing_direction": 90},
"135": {"blowing_direction": 135},
"180": {"blowing_direction": 180},
"225": {"blowing_direction": 225},
"253": {"blowing_direction": 253}
}
},
"heating_direction": {
"options": {
"0": {"heating_direction": 0},
"45": {"heating_direction": 45},
"90": {"heating_direction": 90},
"135": {"heating_direction": 135},
"180": {"heating_direction": 180},
"225": {"heating_direction": 225},
"253": {"heating_direction": 253}
}
},
"light_mode": {
"options": {
"close_all": {"light_mode": "close_all"},
"night_light": {"light_mode": "night_light"},
"main_light": {"light_mode": "main_light"}
}
},
"mode": {
"options": {
"close_all": {"mode": "close_all"},
"strong_heating": {"mode": "strong_heating"},
"weak_heating": {"mode": "weak_heating"},
"heating": {"mode": "heating"},
"bath": {"mode": "bath"},
"soft_wind": {"mode": "soft_wind"},
"ventilation": {"mode": "ventilation"},
"morning_ventilation": {"mode": "morning_ventilation"},
"drying": {"mode": "drying"},
"blowing": {"mode": "blowing"},
"drying_safe_power": {"mode": "drying_safe_power"},
"drying_fast": {"mode": "drying_fast"}
}
},
"bath_direction": {
"options": {
"0": {"bath_direction": 0},
"45": {"bath_direction": 45},
"90": {"bath_direction": 90},
"135": {"bath_direction": 135},
"180": {"bath_direction": 180},
"225": {"bath_direction": 225},
"253": {"bath_direction": 253}
}
},
"drying_direction": {
"options": {
"0": {"drying_direction": 0},
"45": {"drying_direction": 45},
"90": {"drying_direction": 90},
"135": {"drying_direction": 135},
"180": {"drying_direction": 180},
"225": {"drying_direction": 225},
"253": {"drying_direction": 253}
}
}
},
Platform.SENSOR: {
"subpacket_type": {
"device_class": SensorDeviceClass.ENUM,
},
"drying_time": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.MINUTES,
"state_class": SensorStateClass.MEASUREMENT
},
"night_light_brightness": {
"device_class": SensorDeviceClass.ENUM,
},
"bath_heating_time": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.MINUTES,
"state_class": SensorStateClass.MEASUREMENT
},
"main_light_brightness": {
"device_class": SensorDeviceClass.ENUM,
},
"current_temperature": {
"device_class": SensorDeviceClass.TEMPERATURE,
"unit_of_measurement": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT
},
"delay_time": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.MINUTES,
"state_class": SensorStateClass.MEASUREMENT
},
"bath_temperature": {
"device_class": SensorDeviceClass.TEMPERATURE,
"unit_of_measurement": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT
},
"blowing_speed": {
"device_class": SensorDeviceClass.ENUM,
}
}
}
}
}

View File

@@ -409,7 +409,21 @@
"name": "Middle Stair Work Status" "name": "Middle Stair Work Status"
}, },
"mode": { "mode": {
"name": "Mode" "name": "Mode",
"options": {
"close_all": "Close All",
"strong_heating": "Strong Heating",
"weak_heating": "Weak Heating",
"heating": "Heating",
"bath": "Bath",
"soft_wind": "Soft Wind",
"ventilation": "Ventilation",
"morning_ventilation": "Morning Ventilation",
"drying": "Drying",
"blowing": "Blowing",
"drying_safe_power": "Drying Safe Power",
"drying_fast": "Drying Fast"
}
}, },
"mode_state": { "mode_state": {
"name": "Mode State" "name": "Mode State"
@@ -565,6 +579,27 @@
}, },
"left_gear": { "left_gear": {
"name": "Left Gear" "name": "Left Gear"
},
"blowing_direction": {
"name": "Blowing Direction"
},
"heating_direction": {
"name": "Heating Direction"
},
"light_mode": {
"name": "Light Mode",
"options": {
"close_all": "Close All",
"night_light": "Night Light",
"main_light": "Main Light",
"all_on": "All On"
}
},
"bath_direction": {
"name": "Bath Direction"
},
"drying_direction": {
"name": "Drying Direction"
} }
}, },
"sensor": { "sensor": {
@@ -739,9 +774,6 @@
"dehydration_time_value": { "dehydration_time_value": {
"name": "Dehydration Time Value" "name": "Dehydration Time Value"
}, },
"delay_time": {
"name": "Delay Time"
},
"detergent_density_global": { "detergent_density_global": {
"name": "Detergent Density Global" "name": "Detergent Density Global"
}, },
@@ -1090,9 +1122,6 @@
"velocity": { "velocity": {
"name": "Velocity" "name": "Velocity"
}, },
"version": {
"name": "Version"
},
"voice_level": { "voice_level": {
"name": "Voice Level" "name": "Voice Level"
}, },
@@ -1389,6 +1418,30 @@
}, },
"error_type": { "error_type": {
"name": "Error Type" "name": "Error Type"
},
"drying_time": {
"name": "Drying Time"
},
"bath_heating_time": {
"name": "Bath Heating Time"
},
"current_temperature": {
"name": "Current Temperature"
},
"bath_temperature": {
"name": "Bath Temperature"
},
"main_light_brightness": {
"name": "Main Light Brightness"
},
"night_light_brightness": {
"name": "Night Light Brightness"
},
"blowing_speed": {
"name": "Blowing Speed"
},
"delay_time": {
"name": "Delay Time"
} }
}, },
"switch": { "switch": {
@@ -2198,6 +2251,39 @@
}, },
"light_lampblack_mode": { "light_lampblack_mode": {
"name": "Light Lampblack Mode" "name": "Light Lampblack Mode"
},
"blowing_direction": {
"name": "Blowing Direction"
},
"function_led_enable": {
"name": "Function LED Enable"
},
"smelly_trigger": {
"name": "Smelly Trigger"
},
"heating_direction": {
"name": "Heating Direction"
},
"light_mode": {
"name": "Light Mode"
},
"wifi_led_enable": {
"name": "WiFi LED Enable"
},
"bath_direction": {
"name": "Bath Direction"
},
"delay_enable": {
"name": "Delay Enable"
},
"digit_led_enable": {
"name": "Digit LED Enable"
},
"dehumidity_trigger": {
"name": "Dehumidity Trigger"
},
"drying_direction": {
"name": "Drying Direction"
} }
} }
} }

View File

@@ -409,7 +409,21 @@
"name": "中层工作状态" "name": "中层工作状态"
}, },
"mode": { "mode": {
"name": "模式" "name": "模式",
"options": {
"close_all": "全部关闭",
"strong_heating": "强力加热",
"weak_heating": "弱力加热",
"heating": "加热",
"bath": "浴室",
"soft_wind": "柔风",
"ventilation": "通风",
"morning_ventilation": "晨间通风",
"drying": "烘干",
"blowing": "吹风",
"drying_safe_power": "安全功率烘干",
"drying_fast": "快速烘干"
}
}, },
"mode_state": { "mode_state": {
"name": "模式状态" "name": "模式状态"
@@ -565,6 +579,27 @@
}, },
"left_gear": { "left_gear": {
"name": "左侧档位" "name": "左侧档位"
},
"blowing_direction": {
"name": "吹风方向"
},
"heating_direction": {
"name": "加热方向"
},
"light_mode": {
"name": "灯光模式",
"options": {
"close_all": "全部关闭",
"night_light": "夜灯",
"main_light": "主灯",
"all_on": "全部开启"
}
},
"bath_direction": {
"name": "浴室方向"
},
"drying_direction": {
"name": "烘干方向"
} }
}, },
"sensor": { "sensor": {
@@ -739,9 +774,6 @@
"dehydration_time_value": { "dehydration_time_value": {
"name": "脱水时间值" "name": "脱水时间值"
}, },
"delay_time": {
"name": "预约时间"
},
"detergent_density_global": { "detergent_density_global": {
"name": "洗涤剂浓度全局" "name": "洗涤剂浓度全局"
}, },
@@ -772,9 +804,6 @@
"dust_count": { "dust_count": {
"name": "灰尘计数" "name": "灰尘计数"
}, },
"e_version": {
"name": "E 版本"
},
"error": { "error": {
"name": "错误" "name": "错误"
}, },
@@ -1201,9 +1230,6 @@
"uv_sterilize_second": { "uv_sterilize_second": {
"name": "紫外线杀菌秒" "name": "紫外线杀菌秒"
}, },
"version": {
"name": "版本"
},
"volume": { "volume": {
"name": "音量" "name": "音量"
}, },
@@ -1392,6 +1418,30 @@
}, },
"error_type": { "error_type": {
"name": "错误类型" "name": "错误类型"
},
"drying_time": {
"name": "烘干时间"
},
"bath_heating_time": {
"name": "浴室加热时间"
},
"current_temperature": {
"name": "当前温度"
},
"bath_temperature": {
"name": "浴室温度"
},
"main_light_brightness": {
"name": "主灯亮度"
},
"night_light_brightness": {
"name": "夜灯亮度"
},
"blowing_speed": {
"name": "吹风速度"
},
"delay_time": {
"name": "延时时间"
} }
}, },
"switch": { "switch": {
@@ -2201,6 +2251,39 @@
}, },
"light_lampblack_mode": { "light_lampblack_mode": {
"name": "灯光油烟模式" "name": "灯光油烟模式"
},
"blowing_direction": {
"name": "吹风方向"
},
"function_led_enable": {
"name": "功能LED启用"
},
"smelly_trigger": {
"name": "异味触发"
},
"heating_direction": {
"name": "加热方向"
},
"light_mode": {
"name": "灯光模式"
},
"wifi_led_enable": {
"name": "WiFi LED启用"
},
"bath_direction": {
"name": "浴室方向"
},
"delay_enable": {
"name": "延时启用"
},
"digit_led_enable": {
"name": "数字LED启用"
},
"dehumidity_trigger": {
"name": "除湿触发"
},
"drying_direction": {
"name": "烘干方向"
} }
} }
} }