mirror of
https://github.com/sususweet/midea-meiju-codec.git
synced 2025-12-22 12:27:12 +00:00
feat: add device mapping for T0x17 and T0xBC.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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 对开门冰箱
|
||||||
|
|||||||
44
custom_components/midea_auto_cloud/device_mapping/T0x17.py
Normal file
44
custom_components/midea_auto_cloud/device_mapping/T0x17.py
Normal 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,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
57
custom_components/midea_auto_cloud/device_mapping/T0xBC.py
Normal file
57
custom_components/midea_auto_cloud/device_mapping/T0xBC.py
Normal 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
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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": "冬季模式"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user