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 空调
- T0xB2 电蒸箱
- 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

@@ -67,10 +67,10 @@
"server": "Server"
}
},
"reset":{
"reset": {
"title": "Reset the configuration of appliance",
"description": "Remove the old configuration and make a new configuration use template\nIf your configuration was modified, the changes will lost\nIf your appliance type or model not in template, then the new configuration won't be made",
"data":{
"data": {
"check": "I know that, do it"
}
},
@@ -82,7 +82,7 @@
"title": "Option"
}
},
"abort":{
"abort": {
"reset_success": "Reset done",
"account_unsupport_config": "Doesn't support this operation"
}
@@ -91,7 +91,7 @@
"set_attribute": {
"name": "set the attributes",
"description": "Set the attributes of appliance in a dict",
"fields" : {
"fields": {
"device_id": {
"name": "Appliance code",
"description": "Appliance code (Device ID)"
@@ -105,7 +105,7 @@
"send_command": {
"name": "Custom command",
"description": "Send a custom command to appliance",
"fields" : {
"fields": {
"device_id": {
"name": "Appliance code",
"description": "Appliance code (Device ID)"
@@ -409,7 +409,21 @@
"name": "Middle Stair Work Status"
},
"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": {
"name": "Mode State"
@@ -565,6 +579,27 @@
},
"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": {
@@ -739,9 +774,6 @@
"dehydration_time_value": {
"name": "Dehydration Time Value"
},
"delay_time": {
"name": "Delay Time"
},
"detergent_density_global": {
"name": "Detergent Density Global"
},
@@ -1090,9 +1122,6 @@
"velocity": {
"name": "Velocity"
},
"version": {
"name": "Version"
},
"voice_level": {
"name": "Voice Level"
},
@@ -1389,6 +1418,30 @@
},
"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": {
@@ -2198,6 +2251,39 @@
},
"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

@@ -67,10 +67,10 @@
"server": "服务器"
}
},
"reset":{
"reset": {
"title": "重置配置文件",
"description": "移除已有的设备配置,并使用标准模板重新生成设备配置\n如果你的设备配置json文件进行过修改重置之后修改将丢失\n如果标准模板中没有该设备类型则不会生成设备配置",
"data":{
"data": {
"check": "我知道了,重置吧"
}
},
@@ -82,7 +82,7 @@
"title": "配置"
}
},
"abort":{
"abort": {
"reset_success": "重置完成,已尝试生成新的配置",
"account_unsupport_config": "账户配置不支持该操作"
}
@@ -91,7 +91,7 @@
"set_attribute": {
"name": "设置属性",
"description": "设置设备的属性值(可多属性一起设置)",
"fields" : {
"fields": {
"device_id": {
"name": "设备编码",
"description": "设备编码(Device ID)"
@@ -105,7 +105,7 @@
"send_command": {
"name": "自定义命令",
"description": "向设备发送一个自定义命令",
"fields" : {
"fields": {
"device_id": {
"name": "设备编码",
"description": "设备编码(Device ID)"
@@ -409,7 +409,21 @@
"name": "中层工作状态"
},
"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": {
"name": "模式状态"
@@ -565,6 +579,27 @@
},
"left_gear": {
"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": {
@@ -739,9 +774,6 @@
"dehydration_time_value": {
"name": "脱水时间值"
},
"delay_time": {
"name": "预约时间"
},
"detergent_density_global": {
"name": "洗涤剂浓度全局"
},
@@ -772,9 +804,6 @@
"dust_count": {
"name": "灰尘计数"
},
"e_version": {
"name": "E 版本"
},
"error": {
"name": "错误"
},
@@ -1201,9 +1230,6 @@
"uv_sterilize_second": {
"name": "紫外线杀菌秒"
},
"version": {
"name": "版本"
},
"volume": {
"name": "音量"
},
@@ -1392,6 +1418,30 @@
},
"error_type": {
"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": {
@@ -2201,6 +2251,39 @@
},
"light_lampblack_mode": {
"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": "烘干方向"
}
}
}