Files
midea-meiju-codec/custom_components/midea_auto_cloud/device_mapping/T0xFB.py
Cyborg2017 8820dbe8b1 fix: move gear setting to preset_mode for T0xFB(570667EC)
* also add support for cur_temperature sensor
2026-01-07 00:19:33 +08:00

115 lines
4.2 KiB
Python

from homeassistant.const import Platform, UnitOfTemperature, UnitOfVolume, UnitOfTime, PERCENTAGE, PRECISION_HALVES, \
PRECISION_WHOLE, UnitOfEnergy, UnitOfPower
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.switch import SwitchDeviceClass
DEVICE_MAPPING = {
"default": {
"rationale": ["off", "on"],
"queries": [{}],
"centralized": [],
"entities": {
Platform.SWITCH: {
"lock": {
"device_class": SwitchDeviceClass.SWITCH,
},
"screen_close": {
"device_class": SwitchDeviceClass.SWITCH,
"rationale": ["on", "off"],
}
},
Platform.CLIMATE: {
"electric_heater": {
"power": "power",
"hvac_modes": {
"off": {"power": "off"},
"heat": {"power": "on"}
},
"target_temperature": "temperature",
"current_temperature": "cur_temperature",
"min_temp": 5,
"max_temp": 35,
"temperature_unit": UnitOfTemperature.CELSIUS,
"precision": PRECISION_HALVES,
}
},
Platform.SELECT: {
"gear": {
"options": {
"low": {"gear": 1},
"high": {"gear": 3}
}
}
},
Platform.SENSOR: {
"power_statistics": {
"device_class": SensorDeviceClass.POWER,
"unit_of_measurement": UnitOfPower.WATT,
"state_class": SensorStateClass.MEASUREMENT
}
}
}
},
"570667EC": {
"rationale": ["off", "on"],
"queries": [{}],
"centralized": [],
"entities": {
Platform.SWITCH: {
"auto_power_off": {
"device_class": SwitchDeviceClass.SWITCH,
},
"humidification": {
"device_class": SwitchDeviceClass.SWITCH,
"rationale": ['off', 'no_change'],
},
"lock": {
"device_class": SwitchDeviceClass.SWITCH,
"translation_key": "child_lock",
},
"screen_close": {
"device_class": SwitchDeviceClass.SWITCH,
"rationale": ['on', 'off'],
},
"voice": {
"device_class": SwitchDeviceClass.SWITCH,
"rationale": ['close_buzzer', 'open_buzzer'],
}
},
Platform.CLIMATE: {
"electric_heater": {
"power": "power",
"hvac_modes": {
"off": {"power": "off"},
"heat": {"power": "on"}
},
"preset_modes": {
"left_warm": {"gear": 1},
"right_warm": {"gear": 2},
"full_on": {"gear": 3}
},
"target_temperature": "temperature",
"current_temperature": "cur_temperature",
"min_temp": 5,
"max_temp": 35,
"temperature_unit": UnitOfTemperature.CELSIUS,
"precision": PRECISION_WHOLE,
}
},
Platform.SENSOR: {
"power_statistics": {
"device_class": SensorDeviceClass.POWER,
"unit_of_measurement": UnitOfPower.WATT,
"state_class": SensorStateClass.MEASUREMENT
},
"cur_temperature": {
"device_class": SensorDeviceClass.TEMPERATURE,
"unit_of_measurement": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT
}
}
}
}
}