feat: update device T0xE1 control strategy.

This commit is contained in:
sususweet
2025-10-04 23:34:27 +08:00
parent 0ec6b763cd
commit 1f555800f3
3 changed files with 36 additions and 39 deletions

View File

@@ -5,34 +5,28 @@ from homeassistant.components.switch import SwitchDeviceClass
DEVICE_MAPPING = { DEVICE_MAPPING = {
"default": { "default": {
"rationale": ["off", "on"], "rationale": [0, 1],
"queries": [{}], "queries": [{}],
"centralized": [], "centralized": [],
"entities": { "entities": {
Platform.SWITCH: { Platform.SWITCH: {
"airswitch": { "airswitch": {
"device_class": SwitchDeviceClass.SWITCH, "device_class": SwitchDeviceClass.SWITCH,
"rationale": [0, 1]
}, },
"waterswitch": { "waterswitch": {
"device_class": SwitchDeviceClass.SWITCH, "device_class": SwitchDeviceClass.SWITCH,
"rationale": [0, 1]
}, },
"uvswitch": { "uvswitch": {
"device_class": SwitchDeviceClass.SWITCH, "device_class": SwitchDeviceClass.SWITCH,
"rationale": [0, 1]
}, },
"doorswitch": { "doorswitch": {
"device_class": SwitchDeviceClass.SWITCH, "device_class": SwitchDeviceClass.SWITCH,
"rationale": [0, 1]
}, },
"dryswitch": { "dryswitch": {
"device_class": SwitchDeviceClass.SWITCH, "device_class": SwitchDeviceClass.SWITCH,
"rationale": [0, 1]
}, },
"dry_step_switch": { "dry_step_switch": {
"device_class": SwitchDeviceClass.SWITCH, "device_class": SwitchDeviceClass.SWITCH,
"rationale": [0, 1]
} }
}, },
Platform.BINARY_SENSOR: { Platform.BINARY_SENSOR: {
@@ -40,16 +34,16 @@ DEVICE_MAPPING = {
"device_class": BinarySensorDeviceClass.RUNNING, "device_class": BinarySensorDeviceClass.RUNNING,
}, },
"water_lack": { "water_lack": {
"device_class": BinarySensorDeviceClass.RUNNING, "device_class": BinarySensorDeviceClass.PROBLEM,
}, },
"softwater_lack": { "softwater_lack": {
"device_class": BinarySensorDeviceClass.RUNNING, "device_class": BinarySensorDeviceClass.PROBLEM,
}, },
"wash_stage":{ "wash_stage":{
"device_class": BinarySensorDeviceClass.RUNNING, "device_class": BinarySensorDeviceClass.RUNNING,
}, },
"bright_lack": { "bright_lack": {
"device_class": BinarySensorDeviceClass.RUNNING, "device_class": BinarySensorDeviceClass.PROBLEM,
}, },
"diy_flag": { "diy_flag": {
"device_class": BinarySensorDeviceClass.RUNNING, "device_class": BinarySensorDeviceClass.RUNNING,
@@ -69,33 +63,36 @@ DEVICE_MAPPING = {
"options": { "options": {
"power_off": {"work_status": "power_off" }, "power_off": {"work_status": "power_off" },
"power_on": {"work_status": "power_on" }, "power_on": {"work_status": "power_on" },
"cancel": {"work_status": "cancel" },
"pause": {"operator":"pause"},
"resume": {"operator":"start"},
} }
}, },
"wash_mode": { "wash_mode": {
"options": { "options": {
"neutral_gear": {"mode": "neutral_gear"}, "neutral_gear": {"work_status": "work", "mode": "neutral_gear"},
"auto_wash": {"mode": "auto_wash"}, "auto_wash": {"work_status": "work", "mode": "auto_wash"},
"strong_wash": {"mode": "strong_wash"}, "strong_wash": {"work_status": "work", "mode": "strong_wash"},
"standard_wash": {"mode": "standard_wash"}, "standard_wash": {"work_status": "work", "mode": "standard_wash"},
"eco_wash": {"mode": "eco_wash"}, "eco_wash": {"work_status":"work","mode":"eco_wash","additional":0,"wash_region":3},
"glass_wash": {"mode": "glass_wash"}, "glass_wash": {"work_status": "work", "mode": "glass_wash"},
"hour_wash": {"mode": "hour_wash"}, "hour_wash": {"work_status": "work", "mode": "hour_wash"},
"fast_wash": {"mode": "fast_wash"}, "fast_wash": {"work_status": "work", "mode": "fast_wash"},
"soak_wash": {"mode": "soak_wash"}, "soak_wash": {"work_status": "work", "mode": "soak_wash"},
"90min_wash": {"mode": "90min_wash"}, "90min_wash": {"work_status": "work", "mode": "90min_wash"},
"self_clean": {"mode": "self_clean"}, "self_clean": {"work_status": "work", "mode": "self_clean"},
"fruit_wash": {"mode": "fruit_wash"}, "fruit_wash": {"work_status": "work", "mode": "fruit_wash"},
"self_define": {"mode": "self_define"}, "self_define": {"work_status": "work", "mode": "self_define"},
"germ": {"mode": "germ"}, "germ": {"work_status": "work", "mode": "germ"},
"bowl_wash": {"mode": "bowl_wash"}, "bowl_wash": {"work_status": "work", "mode": "bowl_wash"},
"kill_germ": {"mode": "kill_germ"}, "kill_germ": {"work_status": "work", "mode": "kill_germ"},
"seafood_wash": {"mode": "seafood_wash"}, "seafood_wash": {"work_status": "work", "mode": "seafood_wash"},
"hotpot_wash": {"mode": "hotpot_wash"}, "hotpot_wash": {"work_status": "work", "mode": "hotpot_wash"},
"quietnight_wash": {"mode": "quietnight_wash"}, "quietnight_wash": {"work_status": "work", "mode": "quietnight_wash"},
"less_wash": {"mode": "less_wash"}, "less_wash": {"work_status": "work", "mode": "less_wash"},
"oilnet_wash": {"mode": "oilnet_wash"} "oilnet_wash": {"work_status": "work", "mode": "oilnet_wash"}
} }
}, }
}, },
Platform.SENSOR: { Platform.SENSOR: {
"bright": { "bright": {
@@ -115,7 +112,7 @@ DEVICE_MAPPING = {
}, },
"left_time": { "left_time": {
"device_class": SensorDeviceClass.DURATION, "device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.HOURS, "unit_of_measurement": UnitOfTime.MINUTES,
"state_class": SensorStateClass.MEASUREMENT "state_class": SensorStateClass.MEASUREMENT
}, },
"air_set_hour": { "air_set_hour": {

View File

@@ -507,6 +507,9 @@
"work_status": { "work_status": {
"name": "Work Status" "name": "Work Status"
}, },
"wash_mode": {
"name": "Wash Mode"
},
"voice": { "voice": {
"name": "Voice" "name": "Voice"
}, },
@@ -2184,9 +2187,6 @@
"filter_notification": { "filter_notification": {
"name": "Filter Notification" "name": "Filter Notification"
}, },
"wash_mode": {
"name": "Wash Mode"
},
"left_power": { "left_power": {
"name": "Left Power" "name": "Left Power"
}, },

View File

@@ -492,6 +492,9 @@
"work_mode": { "work_mode": {
"name": "工作模式" "name": "工作模式"
}, },
"wash_mode": {
"name": "洗涤模式"
},
"func_select": { "func_select": {
"name": "功能选择" "name": "功能选择"
}, },
@@ -2187,9 +2190,6 @@
"filter_notification": { "filter_notification": {
"name": "滤网提醒" "name": "滤网提醒"
}, },
"wash_mode": {
"name": "洗涤模式"
},
"left_power": { "left_power": {
"name": "左侧电源" "name": "左侧电源"
}, },