feat: add device mapping for T0x17 and T0xBC.

This commit is contained in:
sususweet
2025-12-20 00:51:37 +08:00
parent 3619b06af1
commit f1513b8f0e
6 changed files with 129 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ Get devices from MSmartHome/Midea Meiju homes through the network and control th
- T0x13 Electric Light - T0x13 Electric Light
- T0x15 Water Heater - T0x15 Water Heater
- T0x17 Laundry Machine
- T0x21 Central Air Conditioning Gateway - T0x21 Central Air Conditioning Gateway
- T0x26 Bath Heater - T0x26 Bath Heater
- T0x3D Water Heater - T0x3D Water Heater
@@ -32,6 +33,7 @@ Get devices from MSmartHome/Midea Meiju homes through the network and control th
- T0xB6 Range Hood - T0xB6 Range Hood
- T0xB7 Gas Stove - T0xB7 Gas Stove
- T0xB8 Smart Robot Vacuum - T0xB8 Smart Robot Vacuum
- T0xBC Air Sensor
- T0xBF Microwave Steam Oven - T0xBF Microwave Steam Oven
- T0xC3 Heat Pump - T0xC3 Heat Pump
- T0xCA French Door Refrigerator - T0xCA French Door Refrigerator

View File

@@ -20,6 +20,7 @@
- T0x13 电灯 - T0x13 电灯
- T0x15 养生壶 - T0x15 养生壶
- T0x17 智能晾衣架
- T0x21 中央空调网关 - T0x21 中央空调网关
- T0x26 浴霸 - T0x26 浴霸
- T0x3D 电热水瓶 - T0x3D 电热水瓶
@@ -32,6 +33,7 @@
- T0xB6 抽油烟机 - T0xB6 抽油烟机
- T0xB7 燃气灶 - T0xB7 燃气灶
- T0xB8 智能扫地机器人 - T0xB8 智能扫地机器人
- T0xBC 空气检测仪
- T0xBF 微波炉 - T0xBF 微波炉
- T0xC3 热泵 - T0xC3 热泵
- T0xCA 对开门冰箱 - T0xCA 对开门冰箱

View File

@@ -0,0 +1,44 @@
from homeassistant.components.switch import SwitchDeviceClass
from homeassistant.const import Platform, UnitOfTime, UnitOfArea, UnitOfTemperature
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
DEVICE_MAPPING = {
"default": {
"rationale": ["off", "on"],
"queries": [{}],
"centralized": [],
"entities": {
Platform.SELECT:{
"updown": {
"options": {
"up": {"updown": "up"},
"down": {"updown": "down"},
"pause": {"updown": "pause"}
},
}
},
Platform.NUMBER: {
"light_brightness": {
"min": 20,
"max": 100,
"step": 1
},
"custom_height": {
"min": 0,
"max": 100,
"step": 10,
"translation_key": "laundry_height",
}
},
Platform.SWITCH: {
"light": {
"device_class": SwitchDeviceClass.SWITCH,
},
"laundry": {
"device_class": SwitchDeviceClass.SWITCH,
}
},
}
}
}

View File

@@ -0,0 +1,57 @@
from homeassistant.const import Platform, UnitOfTime, UnitOfArea, CONCENTRATION_PARTS_PER_MILLION, \
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, UnitOfTemperature, UnitOfElectricPotential
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
DEVICE_MAPPING = {
"default": {
"rationale": ["off", "on"],
"queries": [{}],
"calculate": {
"get": [
{
"lvalue": "[indoor_temperature]",
"rvalue": "float([temperature]) / 10"
},
],
},
"centralized": [],
"entities": {
Platform.SENSOR: {
"indoor_temperature": {
"device_class": SensorDeviceClass.TEMPERATURE,
"unit_of_measurement": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT
},
"humidity": {
"device_class": SensorDeviceClass.HUMIDITY,
"unit_of_measurement": "%",
"state_class": SensorStateClass.MEASUREMENT
},
"co2_value": {
"device_class": SensorDeviceClass.CO2,
"unit_of_measurement": CONCENTRATION_PARTS_PER_MILLION,
"state_class": SensorStateClass.MEASUREMENT,
"attribute": "co2"
},
"pm10_value": {
"device_class": SensorDeviceClass.PM10,
"unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
"state_class": SensorStateClass.MEASUREMENT,
"attribute": "pm10"
},
"pm25_value": {
"device_class": SensorDeviceClass.PM25,
"unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
"state_class": SensorStateClass.MEASUREMENT,
"attribute": "pm25"
},
"voltage": {
"device_class": SensorDeviceClass.VOLTAGE,
"unit_of_measurement": UnitOfElectricPotential.VOLT,
"state_class": SensorStateClass.MEASUREMENT
},
}
}
}
}

View File

@@ -388,6 +388,9 @@
} }
}, },
"select": { "select": {
"updown": {
"name": "Up/Down"
},
"ud_swing_angle": { "ud_swing_angle": {
"name": "UD Swing Angle" "name": "UD Swing Angle"
}, },
@@ -1811,6 +1814,12 @@
} }
}, },
"number": { "number": {
"light_brightness": {
"name": "Light Brightness"
},
"laundry_height": {
"name": "Laundry Height"
},
"water_quality": { "water_quality": {
"name": "Water Quality" "name": "Water Quality"
}, },
@@ -1866,6 +1875,9 @@
} }
}, },
"switch": { "switch": {
"laundry": {
"name": "One Key Laundry"
},
"winter_mode": { "winter_mode": {
"name": "Winter Mode" "name": "Winter Mode"
}, },

View File

@@ -388,6 +388,9 @@
} }
}, },
"select": { "select": {
"updown": {
"name": "上升/下降"
},
"ud_swing_angle": { "ud_swing_angle": {
"name": "上下摆风角度" "name": "上下摆风角度"
}, },
@@ -1906,6 +1909,12 @@
} }
}, },
"number": { "number": {
"light_brightness": {
"name": "灯光亮度"
},
"laundry_height": {
"name": "一键晾衣高度"
},
"water_quality": { "water_quality": {
"name": "水质" "name": "水质"
}, },
@@ -1961,6 +1970,9 @@
} }
}, },
"switch": { "switch": {
"laundry": {
"name": "一键晾衣"
},
"winter_mode": { "winter_mode": {
"name": "冬季模式" "name": "冬季模式"
}, },