mirror of
https://github.com/sususweet/midea-meiju-codec.git
synced 2025-11-12 07:51:54 +00:00
feat: add support for T0xFC. Fix #47.
This commit is contained in:
@@ -48,6 +48,7 @@ Get devices from MSmartHome/Midea Meiju homes through the network and control th
|
|||||||
- T0xED Water Softener
|
- T0xED Water Softener
|
||||||
- T0xFA Electric Fan
|
- T0xFA Electric Fan
|
||||||
- T0xFB Electric Heater
|
- T0xFB Electric Heater
|
||||||
|
- T0xFC Air Purifier
|
||||||
- T0xFD Humidifier
|
- T0xFD Humidifier
|
||||||
|
|
||||||
Welcome to collaborate on adding support for more devices.
|
Welcome to collaborate on adding support for more devices.
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
- T0xED 软水机
|
- T0xED 软水机
|
||||||
- T0xFA 电风扇
|
- T0xFA 电风扇
|
||||||
- T0xFB 电暖器
|
- T0xFB 电暖器
|
||||||
|
- T0xFC 空气净化器
|
||||||
- T0xFD 加湿器
|
- T0xFD 加湿器
|
||||||
|
|
||||||
欢迎合作开发添加更多设备支持。
|
欢迎合作开发添加更多设备支持。
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from homeassistant.const import Platform, UnitOfTemperature, PRECISION_HALVES
|
from homeassistant.const import Platform, UnitOfTemperature, PRECISION_HALVES, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, \
|
||||||
|
CONCENTRATION_PARTS_PER_MILLION
|
||||||
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
|
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
|
||||||
from homeassistant.components.switch import SwitchDeviceClass
|
from homeassistant.components.switch import SwitchDeviceClass
|
||||||
|
|
||||||
@@ -107,19 +108,19 @@ DEVICE_MAPPING = {
|
|||||||
},
|
},
|
||||||
"co2_value": {
|
"co2_value": {
|
||||||
"device_class": SensorDeviceClass.CO2,
|
"device_class": SensorDeviceClass.CO2,
|
||||||
"unit_of_measurement": "ppm",
|
"unit_of_measurement": CONCENTRATION_PARTS_PER_MILLION,
|
||||||
"state_class": SensorStateClass.MEASUREMENT,
|
"state_class": SensorStateClass.MEASUREMENT,
|
||||||
"attribute": "co2.value"
|
"attribute": "co2.value"
|
||||||
},
|
},
|
||||||
"hcho_value": {
|
"hcho_value": {
|
||||||
"device_class": SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
|
"device_class": SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
|
||||||
"unit_of_measurement": "μg/m³",
|
"unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
"state_class": SensorStateClass.MEASUREMENT,
|
"state_class": SensorStateClass.MEASUREMENT,
|
||||||
"attribute": "hcho.value"
|
"attribute": "hcho.value"
|
||||||
},
|
},
|
||||||
"pm25_value": {
|
"pm25_value": {
|
||||||
"device_class": SensorDeviceClass.PM25,
|
"device_class": SensorDeviceClass.PM25,
|
||||||
"unit_of_measurement": "μg/m³",
|
"unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
"state_class": SensorStateClass.MEASUREMENT,
|
"state_class": SensorStateClass.MEASUREMENT,
|
||||||
"attribute": "pm2_5.value"
|
"attribute": "pm2_5.value"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from homeassistant.const import Platform, UnitOfTemperature, UnitOfTime
|
from homeassistant.const import Platform, UnitOfTemperature, UnitOfTime, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, \
|
||||||
|
CONCENTRATION_PARTS_PER_MILLION
|
||||||
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
|
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
||||||
from homeassistant.components.switch import SwitchDeviceClass
|
from homeassistant.components.switch import SwitchDeviceClass
|
||||||
@@ -168,12 +169,12 @@ DEVICE_MAPPING = {
|
|||||||
},
|
},
|
||||||
"pm25_value": {
|
"pm25_value": {
|
||||||
"device_class": SensorDeviceClass.PM25,
|
"device_class": SensorDeviceClass.PM25,
|
||||||
"unit_of_measurement": "µg/m³",
|
"unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
"state_class": SensorStateClass.MEASUREMENT
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
},
|
},
|
||||||
"co2_value": {
|
"co2_value": {
|
||||||
"device_class": SensorDeviceClass.CO2,
|
"device_class": SensorDeviceClass.CO2,
|
||||||
"unit_of_measurement": "ppm",
|
"unit_of_measurement": CONCENTRATION_PARTS_PER_MILLION,
|
||||||
"state_class": SensorStateClass.MEASUREMENT
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
},
|
},
|
||||||
"machine_type": {
|
"machine_type": {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from homeassistant.const import Platform, UnitOfTemperature, UnitOfTime, PERCENTAGE, PRECISION_HALVES
|
from homeassistant.const import Platform, UnitOfTemperature, UnitOfTime, PERCENTAGE, PRECISION_HALVES, \
|
||||||
|
CONCENTRATION_PARTS_PER_MILLION
|
||||||
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
|
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
||||||
from homeassistant.components.switch import SwitchDeviceClass
|
from homeassistant.components.switch import SwitchDeviceClass
|
||||||
@@ -155,7 +156,7 @@ DEVICE_MAPPING = {
|
|||||||
},
|
},
|
||||||
"tds_value": {
|
"tds_value": {
|
||||||
"device_class": SensorDeviceClass.WATER,
|
"device_class": SensorDeviceClass.WATER,
|
||||||
"unit_of_measurement": "ppm",
|
"unit_of_measurement": CONCENTRATION_PARTS_PER_MILLION,
|
||||||
"state_class": SensorStateClass.MEASUREMENT
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
},
|
},
|
||||||
"heat_water_level": {
|
"heat_water_level": {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from homeassistant.const import Platform, UnitOfTemperature, UnitOfTime, PERCENTAGE, DEGREE
|
from homeassistant.const import Platform, UnitOfTemperature, UnitOfTime, PERCENTAGE, DEGREE, \
|
||||||
|
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER
|
||||||
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
|
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
||||||
from homeassistant.components.switch import SwitchDeviceClass
|
from homeassistant.components.switch import SwitchDeviceClass
|
||||||
@@ -94,7 +95,7 @@ DEVICE_MAPPING = {
|
|||||||
},
|
},
|
||||||
"pm25": {
|
"pm25": {
|
||||||
"device_class": SensorDeviceClass.PM25,
|
"device_class": SensorDeviceClass.PM25,
|
||||||
"unit_of_measurement": "µg/m³",
|
"unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
"state_class": SensorStateClass.MEASUREMENT
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
},
|
},
|
||||||
"ud_swing_angle": {
|
"ud_swing_angle": {
|
||||||
|
|||||||
103
custom_components/midea_auto_cloud/device_mapping/T0xFC.py
Normal file
103
custom_components/midea_auto_cloud/device_mapping/T0xFC.py
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
from homeassistant.const import Platform, UnitOfTemperature, UnitOfVolume, UnitOfTime, PERCENTAGE, PRECISION_HALVES, \
|
||||||
|
UnitOfEnergy, UnitOfPower, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER
|
||||||
|
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: {
|
||||||
|
"power": {
|
||||||
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
|
},
|
||||||
|
"anion": {
|
||||||
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
|
},
|
||||||
|
"buzzer": {
|
||||||
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
|
},
|
||||||
|
"lock": {
|
||||||
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
|
},
|
||||||
|
"waterions":{
|
||||||
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Platform.SELECT: {
|
||||||
|
"mode": {
|
||||||
|
"options": {
|
||||||
|
"constant_humidity": {"mode": "constant_humidity"},
|
||||||
|
"manual": {"mode": "manual"},
|
||||||
|
"sleep": {"mode": "sleep"},
|
||||||
|
"fast": {"mode": "fast"},
|
||||||
|
"auto": {"mode": "auto"},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bias_gear":{
|
||||||
|
"options": {
|
||||||
|
"瑜伽静修场景": {"mode": "auto", "sub_mode": "denoise", "bias_gear": -20},
|
||||||
|
"室内对话场景": {"mode": "auto", "sub_mode": "denoise", "bias_gear": -10}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bright": {
|
||||||
|
"options": {
|
||||||
|
"全亮": {"bright": 0},
|
||||||
|
"半亮": {"bright": 6},
|
||||||
|
"熄灭": {"bright": 7}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gear": {
|
||||||
|
"options": {
|
||||||
|
"low": {"wind_speed": 1},
|
||||||
|
"medium": {"wind_speed": 2},
|
||||||
|
"high": {"wind_speed": 3}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"humidity": {
|
||||||
|
"options": {
|
||||||
|
"40%": {"humidity": 40},
|
||||||
|
"50%": {"humidity": 50},
|
||||||
|
"60%": {"humidity": 60},
|
||||||
|
"70%": {"humidity": 70}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Platform.SENSOR: {
|
||||||
|
"temperature_feedback": {
|
||||||
|
"device_class": SensorDeviceClass.TEMPERATURE,
|
||||||
|
"unit_of_measurement": UnitOfTemperature.CELSIUS,
|
||||||
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
|
},
|
||||||
|
"humidify_feedback": {
|
||||||
|
"device_class": SensorDeviceClass.HUMIDITY,
|
||||||
|
"unit_of_measurement": "%",
|
||||||
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
|
},
|
||||||
|
"hcho":{
|
||||||
|
"device_class": SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
|
||||||
|
"unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
|
},
|
||||||
|
"pm1":{
|
||||||
|
"device_class": SensorDeviceClass.PM1,
|
||||||
|
"unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
|
},
|
||||||
|
"pm25":{
|
||||||
|
"device_class": SensorDeviceClass.PM25,
|
||||||
|
"unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
|
},
|
||||||
|
"pm10":{
|
||||||
|
"device_class": SensorDeviceClass.PM10,
|
||||||
|
"unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -349,6 +349,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"select": {
|
"select": {
|
||||||
|
"bright": {
|
||||||
|
"name": "Brightness"
|
||||||
|
},
|
||||||
|
"bias_gear": {
|
||||||
|
"name": "Bias Gear"
|
||||||
|
},
|
||||||
|
"humidity": {
|
||||||
|
"name": "Humidity"
|
||||||
|
},
|
||||||
"b6_power": {
|
"b6_power": {
|
||||||
"name": "Smoke Machine Power"
|
"name": "Smoke Machine Power"
|
||||||
},
|
},
|
||||||
@@ -1562,6 +1571,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
|
"waterions": {
|
||||||
|
"name": "Disinfection"
|
||||||
|
},
|
||||||
"mute": {
|
"mute": {
|
||||||
"name": "Mute"
|
"name": "Mute"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -353,6 +353,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"select": {
|
"select": {
|
||||||
|
"bright": {
|
||||||
|
"name": "亮度"
|
||||||
|
},
|
||||||
|
"bias_gear": {
|
||||||
|
"name": "降噪设置"
|
||||||
|
},
|
||||||
|
"humidity": {
|
||||||
|
"name": "设定湿度"
|
||||||
|
},
|
||||||
"b6_power": {
|
"b6_power": {
|
||||||
"name": "烟机开关"
|
"name": "烟机开关"
|
||||||
},
|
},
|
||||||
@@ -1566,6 +1575,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
|
"waterions": {
|
||||||
|
"name": "消杀"
|
||||||
|
},
|
||||||
"mute": {
|
"mute": {
|
||||||
"name": "静音"
|
"name": "静音"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user