Files
midea-meiju-codec/custom_components/midea_auto_cloud/device_mapping/T0xD9.py

153 lines
6.4 KiB
Python
Raw Normal View History

2025-09-24 23:31:31 +08:00
from homeassistant.const import Platform, UnitOfElectricPotential, UnitOfTemperature, UnitOfTime
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.switch import SwitchDeviceClass
DEVICE_MAPPING = {
"default": {
2025-09-30 17:12:35 +08:00
"rationale": ["off", "on"],
2025-12-20 16:09:16 +08:00
"queries": [{"query_type": "db"}],
2025-09-24 23:31:31 +08:00
"calculate": {
"get": [
{
"lvalue": "[remaining_time]",
"rvalue": "[db_remain_time]"
}
],
"set": {
}
},
"entities": {
2025-09-30 17:12:35 +08:00
Platform.BINARY_SENSOR: {
"db_door_opened": {
2026-01-10 13:11:48 +08:00
"device_class": BinarySensorDeviceClass.OPENING,
"translation_key": "door_opened"
},
"db_bucket_water_overheating": {
"device_class": BinarySensorDeviceClass.PROBLEM,
"translation_key": "bucket_water_overheating"
2026-01-10 13:11:48 +08:00
},
"db_drying_tunnel_overheating": {
2026-01-10 13:11:48 +08:00
"device_class": BinarySensorDeviceClass.PROBLEM,
"translation_key": "drying_tunnel_overheating"
2026-01-10 13:11:48 +08:00
},
"db_detergent_needed": {
2026-01-10 13:11:48 +08:00
"device_class": BinarySensorDeviceClass.PROBLEM,
"translation_key": "detergent_lack"
2026-01-10 13:11:48 +08:00
}
2025-09-30 17:12:35 +08:00
},
Platform.SWITCH: {
"db_power": {
"device_class": SwitchDeviceClass.SWITCH,
},
"db_control_status": {
"device_class": SwitchDeviceClass.SWITCH,
"rationale": ["pause", "start"],
"translation_key": "control_status",
2026-01-10 13:11:48 +08:00
},
"db_baby_lock": {
"device_class": SwitchDeviceClass.SWITCH,
"rationale": [0, 1],
2026-01-10 13:11:48 +08:00
"translation_key": "child_lock",
}
2025-09-24 23:31:31 +08:00
},
Platform.SELECT: {
2025-12-20 16:09:16 +08:00
"db_location_selection": {
"options": {
"left": {"db_location_selection": "left"},
"right": {"db_location_selection": "right"}
}
},
2025-09-24 23:31:31 +08:00
"db_program": {
"options": {
2025-09-30 17:12:35 +08:00
"baby_clothes": {"db_program": "baby_clothes"},
"baby_clothes_dry": {"db_program": 151},
"clean_stains": {"db_program": "clean_stains"},
2025-09-30 17:12:35 +08:00
"cold_wash": {"db_program": "cold_wash"},
"cook_wash": {"db_program": "cook_wash"},
"fast_wash": {"db_program": 137},
"hot_wind_dry": {"db_program": 153},
"rinsing_dehydration": {"db_program": "rinsing_dehydration"},
"self_wash_5": {"db_program": "self_wash_5"},
"single_dehytration": {"db_program": "single_dehytration"},
"single_drying": {"db_program": "single_drying"},
"small_wash_dry": {"db_program": 138},
"socks": {"db_program": 148},
"standard": {"db_program": "standard"},
"underpants": {"db_program": 156},
"underwear": {"db_program": "underwear"},
"water_ssp": {"db_program": "water_ssp"}
}
2026-01-10 13:11:48 +08:00
},
"db_temperature": {
"options": {
"冷水": {"db_temperature": 0},
"30℃": {"db_temperature": 3},
"40℃": {"db_temperature": 4},
"60℃": {"db_temperature": 5},
"95℃": {"db_temperature": 6}
2026-01-10 13:11:48 +08:00
},
"translation_key": "temperature"
},
"db_detergent": {
"options": {
"关闭": {"db_detergent": 0},
"L1": {"db_detergent": 1},
"L2": {"db_detergent": 2},
"L3": {"db_detergent": 3}
2026-01-10 13:11:48 +08:00
},
"translation_key": "detergent"
},
"db_dehydration_speed": {
"options": {
"免脱水": {"db_dehydration_speed": 0},
"800转": {"db_dehydration_speed": 3},
"1000转": {"db_dehydration_speed": 4}
2026-01-10 13:11:48 +08:00
},
"translation_key": "dehydration_speed"
},
"db_rinse_count": {
"options": {
"1次": {"db_rinse_count": 1},
"2次": {"db_rinse_count": 2},
"3次": {"db_rinse_count": 3},
"4次": {"db_rinse_count": 4},
"5次": {"db_rinse_count": 5}
2026-01-10 13:11:48 +08:00
},
"translation_key": "soak_count"
},
"db_dry": {
"options": {
"关闭": {"db_dry": 0},
"智能": {"db_dry": 1},
"定时240": {"db_dry": 12},
"定时180": {"db_dry": 11},
"定时120": {"db_dry": 7},
"定时60": {"db_dry": 5},
"定时30": {"db_dry": 4}
2026-01-10 13:11:48 +08:00
}
2025-09-24 23:31:31 +08:00
}
},
Platform.SENSOR: {
"db_remain_time": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.MINUTES,
"state_class": SensorStateClass.MEASUREMENT
},
"db_progress": {
"device_class": SensorDeviceClass.BATTERY,
"unit_of_measurement": "%",
"state_class": SensorStateClass.MEASUREMENT
},
2026-01-10 13:11:48 +08:00
"db_running_status": {
"device_class": SensorDeviceClass.ENUM,
"translation_key": "running_status"
2025-09-24 23:31:31 +08:00
},
2026-01-10 13:11:48 +08:00
"db_error_code": {
2025-09-25 11:45:46 +08:00
"device_class": SensorDeviceClass.ENUM
2025-09-24 23:31:31 +08:00
}
}
}
}
}