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:
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
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user