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
|
2025-09-24 20:56:04 +08:00
|
|
|
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": {
|
2025-09-24 20:56:04 +08:00
|
|
|
Platform.SWITCH: {
|
2025-09-30 14:38:50 +08:00
|
|
|
"power": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"device_class": SwitchDeviceClass.SWITCH,
|
|
|
|
},
|
2025-09-30 14:38:50 +08:00
|
|
|
"heat_start": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"device_class": SwitchDeviceClass.SWITCH,
|
2025-09-30 14:38:50 +08:00
|
|
|
"rationale": [0, 1],
|
2025-09-24 20:56:04 +08:00
|
|
|
},
|
2025-09-30 14:38:50 +08:00
|
|
|
"lock": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"device_class": SwitchDeviceClass.SWITCH,
|
|
|
|
},
|
2025-09-30 14:38:50 +08:00
|
|
|
"sleep": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"device_class": SwitchDeviceClass.SWITCH,
|
|
|
|
},
|
2025-09-30 14:38:50 +08:00
|
|
|
"keep_warm": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"device_class": SwitchDeviceClass.SWITCH,
|
|
|
|
},
|
2025-09-30 14:38:50 +08:00
|
|
|
"vacation": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"device_class": SwitchDeviceClass.SWITCH,
|
|
|
|
},
|
2025-09-30 14:38:50 +08:00
|
|
|
"germicidal": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"device_class": SwitchDeviceClass.SWITCH,
|
|
|
|
},
|
2025-09-30 14:38:50 +08:00
|
|
|
"lack_water": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"device_class": SwitchDeviceClass.SWITCH,
|
|
|
|
},
|
2025-09-30 14:38:50 +08:00
|
|
|
"drainage": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"device_class": SwitchDeviceClass.SWITCH,
|
|
|
|
},
|
2025-09-30 14:38:50 +08:00
|
|
|
"wash_enable": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"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,
|
2025-09-24 20:56:04 +08:00
|
|
|
},
|
|
|
|
"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,
|
2025-09-24 20:56:04 +08:00
|
|
|
"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-24 20:56:04 +08:00
|
|
|
},
|
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-24 20:56:04 +08:00
|
|
|
},
|
2025-09-30 14:38:50 +08:00
|
|
|
"keep_warm_time": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"device_class": SensorDeviceClass.DURATION,
|
|
|
|
"unit_of_measurement": UnitOfTime.MINUTES,
|
|
|
|
"state_class": SensorStateClass.MEASUREMENT
|
|
|
|
},
|
2025-09-30 14:38:50 +08:00
|
|
|
"warm_left_time": {
|
2025-09-24 20:56:04 +08:00
|
|
|
"device_class": SensorDeviceClass.DURATION,
|
|
|
|
"unit_of_measurement": UnitOfTime.MINUTES,
|
|
|
|
"state_class": SensorStateClass.MEASUREMENT
|
|
|
|
},
|
|
|
|
}
|
2025-09-24 18:20:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|