feat: add device support for T0xFB.

This commit is contained in:
sususweet
2025-10-22 16:01:20 +08:00
parent 7327ee3433
commit 087c5db497
5 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
from homeassistant.const import Platform, UnitOfTemperature, UnitOfVolume, UnitOfTime, PERCENTAGE, PRECISION_HALVES, \
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,
}
},
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
}
}
}
}
}

View File

@@ -359,6 +359,9 @@
},
"water_heater": {
"name": "Water Heater"
},
"electric_heater": {
"name": "Electric Heater"
}
},
"humidifier": {
@@ -1530,6 +1533,9 @@
}
},
"switch": {
"screen_close": {
"name": "Screen Close"
},
"anion": {
"name": "Anion"
},

View File

@@ -363,6 +363,9 @@
},
"water_heater": {
"name": "热水器"
},
"electric_heater": {
"name": "取暖器"
}
},
"humidifier": {
@@ -1534,6 +1537,9 @@
}
},
"switch": {
"screen_close": {
"name": "屏幕关闭"
},
"anion": {
"name": "负离子"
},