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

@@ -41,6 +41,7 @@ Get devices from MSmartHome/Midea Meiju homes through the network and control th
- T0xEA Rice Cooker - T0xEA Rice Cooker
- T0xED Water Softener - T0xED Water Softener
- T0xFA Electric Fan - T0xFA Electric Fan
- T0xFB Electric Heater
- T0xFD Humidifier - T0xFD Humidifier
Welcome to collaborate on adding support for more devices. Welcome to collaborate on adding support for more devices.

View File

@@ -41,6 +41,7 @@
- T0xEA 电饭锅 - T0xEA 电饭锅
- T0xED 软水机 - T0xED 软水机
- T0xFA 电风扇 - T0xFA 电风扇
- T0xFB 电暖器
- T0xFD 加湿器 - T0xFD 加湿器
欢迎合作开发添加更多设备支持。 欢迎合作开发添加更多设备支持。

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": { "water_heater": {
"name": "Water Heater" "name": "Water Heater"
},
"electric_heater": {
"name": "Electric Heater"
} }
}, },
"humidifier": { "humidifier": {
@@ -1530,6 +1533,9 @@
} }
}, },
"switch": { "switch": {
"screen_close": {
"name": "Screen Close"
},
"anion": { "anion": {
"name": "Anion" "name": "Anion"
}, },

View File

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