feat: update T0xED mapping.

This commit is contained in:
sususweet
2025-10-05 13:00:50 +08:00
parent 59308d1f4f
commit 1cd31305e5
3 changed files with 208 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
from homeassistant.const import Platform, UnitOfTemperature, PRECISION_HALVES, UnitOfTime, UnitOfElectricPotential, \
from homeassistant.const import Platform, UnitOfTemperature, UnitOfTime, UnitOfElectricPotential, \
UnitOfVolume, UnitOfMass
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
@@ -42,6 +42,30 @@ DEVICE_MAPPING = {
"wash_enable": {
"device_class": SwitchDeviceClass.SWITCH,
},
"water_way": {
"device_class": SwitchDeviceClass.SWITCH,
},
"soften": {
"device_class": SwitchDeviceClass.SWITCH,
},
"regeneration": {
"device_class": SwitchDeviceClass.SWITCH,
},
"maintenance_reminder_switch": {
"device_class": SwitchDeviceClass.SWITCH,
},
"leak_water_protection": {
"device_class": SwitchDeviceClass.SWITCH,
},
"micro_leak_protection": {
"device_class": SwitchDeviceClass.SWITCH,
},
"cl_sterilization": {
"device_class": SwitchDeviceClass.SWITCH,
},
"holiday_mode": {
"device_class": SwitchDeviceClass.SWITCH,
},
},
Platform.BINARY_SENSOR: {
"heat_status": {
@@ -55,6 +79,30 @@ DEVICE_MAPPING = {
},
"rtc_error": {
"device_class": BinarySensorDeviceClass.PROBLEM,
},
"low_salt": {
"device_class": BinarySensorDeviceClass.PROBLEM,
},
"no_salt": {
"device_class": BinarySensorDeviceClass.PROBLEM,
},
"low_battery": {
"device_class": BinarySensorDeviceClass.BATTERY,
},
"flowmeter_error": {
"device_class": BinarySensorDeviceClass.PROBLEM,
},
"salt_level_sensor_error": {
"device_class": BinarySensorDeviceClass.PROBLEM,
},
"leak_water": {
"device_class": BinarySensorDeviceClass.PROBLEM,
},
"micro_leak": {
"device_class": BinarySensorDeviceClass.PROBLEM,
},
"maintenance_remind": {
"device_class": BinarySensorDeviceClass.PROBLEM,
}
},
Platform.SENSOR: {
@@ -83,6 +131,123 @@ DEVICE_MAPPING = {
"unit_of_measurement": UnitOfTime.MINUTES,
"state_class": SensorStateClass.MEASUREMENT
},
"salt_alarm_threshold": {
"device_class": SensorDeviceClass.WEIGHT,
"unit_of_measurement": UnitOfMass.KILOGRAMS,
"state_class": SensorStateClass.MEASUREMENT
},
"left_salt": {
"device_class": SensorDeviceClass.POWER,
"unit_of_measurement": "%",
"state_class": SensorStateClass.MEASUREMENT
},
"salt_setting": {
"device_class": SensorDeviceClass.WEIGHT,
"unit_of_measurement": UnitOfMass.KILOGRAMS,
"state_class": SensorStateClass.MEASUREMENT
},
"supply_voltage": {
"device_class": SensorDeviceClass.VOLTAGE,
"unit_of_measurement": UnitOfElectricPotential.VOLT,
"state_class": SensorStateClass.MEASUREMENT
},
"battery_voltage": {
"device_class": SensorDeviceClass.VOLTAGE,
"unit_of_measurement": UnitOfElectricPotential.VOLT,
"state_class": SensorStateClass.MEASUREMENT
},
"water_hardness": {
"device_class": SensorDeviceClass.WATER,
"unit_of_measurement": "mg/L",
"state_class": SensorStateClass.MEASUREMENT
},
"water_consumption_big": {
"device_class": SensorDeviceClass.VOLUME,
"unit_of_measurement": UnitOfVolume.LITERS,
"state_class": SensorStateClass.TOTAL_INCREASING
},
"water_consumption_today": {
"device_class": SensorDeviceClass.VOLUME,
"unit_of_measurement": UnitOfVolume.LITERS,
"state_class": SensorStateClass.MEASUREMENT
},
"water_consumption_average": {
"device_class": SensorDeviceClass.VOLUME,
"unit_of_measurement": UnitOfVolume.LITERS,
"state_class": SensorStateClass.MEASUREMENT
},
"soft_available_big": {
"device_class": SensorDeviceClass.VOLUME,
"unit_of_measurement": UnitOfVolume.LITERS,
"state_class": SensorStateClass.MEASUREMENT
},
"regeneration_left_seconds": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.SECONDS,
"state_class": SensorStateClass.MEASUREMENT
},
"regeneration_stages": {
"device_class": SensorDeviceClass.ENUM,
},
"regeneration_current_stages": {
"device_class": SensorDeviceClass.ENUM,
},
"regeneration_count": {
"device_class": SensorDeviceClass.ENUM,
},
"days_since_last_regeneration": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.DAYS,
"state_class": SensorStateClass.MEASUREMENT
},
"days_since_last_two_regeneration": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.DAYS,
"state_class": SensorStateClass.MEASUREMENT
},
"use_days": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.DAYS,
"state_class": SensorStateClass.TOTAL_INCREASING
},
"flushing_days": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.DAYS,
"state_class": SensorStateClass.MEASUREMENT
},
"pre_regeneration_days": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.DAYS,
"state_class": SensorStateClass.MEASUREMENT
},
"remind_maintenance_days": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.DAYS,
"state_class": SensorStateClass.MEASUREMENT
},
"maintenance_reminder_setting": {
"device_class": SensorDeviceClass.DURATION,
"unit_of_measurement": UnitOfTime.DAYS,
"state_class": SensorStateClass.MEASUREMENT
},
"micro_leak_protection_value": {
"device_class": SensorDeviceClass.ENUM,
},
"leak_water_protection_value": {
"device_class": SensorDeviceClass.ENUM,
},
"mixed_water_gear": {
"device_class": SensorDeviceClass.ENUM,
},
"velocity": {
"device_class": SensorDeviceClass.ENUM,
},
"error": {
"device_class": SensorDeviceClass.ENUM,
},
"category": {
"device_class": SensorDeviceClass.ENUM,
},
}
}
}