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

90 lines
3.5 KiB
Python
Raw Normal View History

2025-09-30 14:38:50 +08:00
from homeassistant.const import Platform, UnitOfTemperature, PRECISION_HALVES, UnitOfTime, UnitOfElectricPotential, \
UnitOfVolume, UnitOfMass
2025-09-24 18:20:58 +08:00
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
2025-09-24 18:20:58 +08:00
from homeassistant.components.switch import SwitchDeviceClass
DEVICE_MAPPING = {
"default": {
"rationale": ["off", "on"],
"queries": [{}],
"centralized": [],
"entities": {
Platform.SWITCH: {
2025-09-30 14:38:50 +08:00
"power": {
"device_class": SwitchDeviceClass.SWITCH,
},
2025-09-30 14:38:50 +08:00
"heat_start": {
"device_class": SwitchDeviceClass.SWITCH,
2025-09-30 14:38:50 +08:00
"rationale": [0, 1],
},
2025-09-30 14:38:50 +08:00
"lock": {
"device_class": SwitchDeviceClass.SWITCH,
},
2025-09-30 14:38:50 +08:00
"sleep": {
"device_class": SwitchDeviceClass.SWITCH,
},
2025-09-30 14:38:50 +08:00
"keep_warm": {
"device_class": SwitchDeviceClass.SWITCH,
},
2025-09-30 14:38:50 +08:00
"vacation": {
"device_class": SwitchDeviceClass.SWITCH,
},
2025-09-30 14:38:50 +08:00
"germicidal": {
"device_class": SwitchDeviceClass.SWITCH,
},
2025-09-30 14:38:50 +08:00
"lack_water": {
"device_class": SwitchDeviceClass.SWITCH,
},
2025-09-30 14:38:50 +08:00
"drainage": {
"device_class": SwitchDeviceClass.SWITCH,
},
2025-09-30 14:38:50 +08:00
"wash_enable": {
"device_class": SwitchDeviceClass.SWITCH,
},
},
Platform.BINARY_SENSOR: {
2025-09-30 14:38:50 +08:00
"heat_status": {
"device_class": BinarySensorDeviceClass.RUNNING,
},
"standby_status": {
"device_class": BinarySensorDeviceClass.RUNNING,
},
"chlorine_sterilization_error": {
"device_class": BinarySensorDeviceClass.PROBLEM,
},
"rtc_error": {
"device_class": BinarySensorDeviceClass.PROBLEM,
}
},
Platform.SENSOR: {
2025-09-30 14:38:50 +08:00
"current_temperature": {
"device_class": SensorDeviceClass.TEMPERATURE,
"unit_of_measurement": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT
},
2025-09-30 14:38:50 +08:00
"cool_target_temperature": {
"device_class": SensorDeviceClass.TEMPERATURE,
"unit_of_measurement": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT
},
2025-09-30 14:38:50 +08:00
"water_consumption_ml": {
"device_class": SensorDeviceClass.VOLUME,
2025-09-25 11:45:46 +08:00
"unit_of_measurement": UnitOfVolume.LITERS,
"state_class": SensorStateClass.TOTAL_INCREASING
},
2025-09-30 14:38:50 +08:00
"keep_warm_time": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.MINUTES,
"state_class": SensorStateClass.MEASUREMENT
},
2025-09-30 14:38:50 +08:00
"warm_left_time": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.MINUTES,
"state_class": SensorStateClass.MEASUREMENT
},
}
2025-09-24 18:20:58 +08:00
}
}
}