diff --git a/README.md b/README.md index 2d528c2..f665ebb 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Get devices from MSmartHome/Midea Meiju homes through the network and control th - T0x13 Electric Light - T0x15 Water Heater +- T0x17 Laundry Machine - T0x21 Central Air Conditioning Gateway - T0x26 Bath Heater - T0x3D Water Heater @@ -32,6 +33,7 @@ Get devices from MSmartHome/Midea Meiju homes through the network and control th - T0xB6 Range Hood - T0xB7 Gas Stove - T0xB8 Smart Robot Vacuum +- T0xBC Air Sensor - T0xBF Microwave Steam Oven - T0xC3 Heat Pump - T0xCA French Door Refrigerator diff --git a/README_hans.md b/README_hans.md index 4210fad..7d35a85 100644 --- a/README_hans.md +++ b/README_hans.md @@ -20,6 +20,7 @@ - T0x13 电灯 - T0x15 养生壶 +- T0x17 智能晾衣架 - T0x21 中央空调网关 - T0x26 浴霸 - T0x3D 电热水瓶 @@ -32,6 +33,7 @@ - T0xB6 抽油烟机 - T0xB7 燃气灶 - T0xB8 智能扫地机器人 +- T0xBC 空气检测仪 - T0xBF 微波炉 - T0xC3 热泵 - T0xCA 对开门冰箱 diff --git a/custom_components/midea_auto_cloud/device_mapping/T0x17.py b/custom_components/midea_auto_cloud/device_mapping/T0x17.py new file mode 100644 index 0000000..e709ea6 --- /dev/null +++ b/custom_components/midea_auto_cloud/device_mapping/T0x17.py @@ -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, + } + }, + } + } +} diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xBC.py b/custom_components/midea_auto_cloud/device_mapping/T0xBC.py new file mode 100644 index 0000000..19c597d --- /dev/null +++ b/custom_components/midea_auto_cloud/device_mapping/T0xBC.py @@ -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 + }, + } + } + } +} diff --git a/custom_components/midea_auto_cloud/translations/en.json b/custom_components/midea_auto_cloud/translations/en.json index a49f28e..219a392 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -388,6 +388,9 @@ } }, "select": { + "updown": { + "name": "Up/Down" + }, "ud_swing_angle": { "name": "UD Swing Angle" }, @@ -1811,6 +1814,12 @@ } }, "number": { + "light_brightness": { + "name": "Light Brightness" + }, + "laundry_height": { + "name": "Laundry Height" + }, "water_quality": { "name": "Water Quality" }, @@ -1866,6 +1875,9 @@ } }, "switch": { + "laundry": { + "name": "One Key Laundry" + }, "winter_mode": { "name": "Winter Mode" }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index d171923..ac5b442 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -388,6 +388,9 @@ } }, "select": { + "updown": { + "name": "上升/下降" + }, "ud_swing_angle": { "name": "上下摆风角度" }, @@ -1906,6 +1909,12 @@ } }, "number": { + "light_brightness": { + "name": "灯光亮度" + }, + "laundry_height": { + "name": "一键晾衣高度" + }, "water_quality": { "name": "水质" }, @@ -1961,6 +1970,9 @@ } }, "switch": { + "laundry": { + "name": "一键晾衣" + }, "winter_mode": { "name": "冬季模式" },