From 28bbf11e2d85609bce644eb4b0dfbfd4ad631f90 Mon Sep 17 00:00:00 2001 From: Alone Date: Mon, 6 Nov 2023 17:58:16 +0800 Subject: [PATCH] Update miio2miot_specs.py --- .../xiaomi_miot/core/miio2miot_specs.py | 135 +++++++++--------- 1 file changed, 65 insertions(+), 70 deletions(-) diff --git a/custom_components/xiaomi_miot/core/miio2miot_specs.py b/custom_components/xiaomi_miot/core/miio2miot_specs.py index b02d232d5..7d04aae64 100644 --- a/custom_components/xiaomi_miot/core/miio2miot_specs.py +++ b/custom_components/xiaomi_miot/core/miio2miot_specs.py @@ -1401,6 +1401,71 @@ def cbk(prop, params, props, **kwargs): 'viomi.waterheater.u11': 'viomi.waterheater.u7', 'viomi.waterheater.u12': 'viomi.waterheater.u7', + 'xiaomi.aircondition.ma2': { + 'chunk_properties': 1, + 'miio_specs': { + 'prop.2.1': { + 'prop': 'power', + 'setter': True, + 'template': '{{ value != 0 }}', + 'set_template': '{{ [value|int(1)] }}', + }, + 'prop.2.2': {'prop': 'mode', 'setter': 'set_mode', 'dict': { + 2: 1, + 3: 2, + 4: 3, + 5: 4, + }, 'default': 2}, + 'prop.2.3': {'prop': 'settemp', 'setter': 'set_temp'}, + 'prop.2.4': { + 'prop': 'energysave', + 'setter': True, + 'template': '{{ value != 0 }}', + 'set_template': '{{ [value|int(1)] }}', + }, + 'prop.2.5': { + 'prop': 'auxheat', + 'setter': True, + 'template': '{{ value != 0 }}', + 'set_template': '{{ [value|int(1)] }}', + }, + 'prop.2.6': { + 'prop': 'sleep', + 'setter': True, + 'template': '{{ value != 0 }}', + 'set_template': '{{ [value|int(1)] }}', + }, + 'prop.2.7': { + 'prop': 'dry', + 'setter': True, + 'template': '{{ value != 0 }}', + 'set_template': '{{ [value|int(1)] }}', + }, + 'prop.3.1': {'prop': 'wind_level', 'setter': True}, + 'prop.3.2': { + 'prop': 'swing', + 'setter': True, + 'template': '{{ value != 0 }}', + 'set_template': '{{ [value|int(1)] }}', + }, + 'prop.4.1': {'prop': 'temperature'}, + 'prop.5.1': { + 'prop': 'beep', + 'setter': True, + 'template': '{{ value != 0 }}', + 'set_template': '{{ [value|int(1)] }}', + }, + 'prop.6.1': { + 'prop': 'light', + 'setter': True, + 'template': '{{ value != 0 }}', + 'set_template': '{{ [value|int(1)] }}', + }, + }, + }, + 'xiaomi.aircondition.ma4': 'xiaomi.aircondition.ma2', + 'xiaomi.aircondition.ma6': 'xiaomi.aircondition.ma2', + 'xjx.toilet.pro': { 'miio_specs': { 'prop.2.1': {'prop': 'seating'}, @@ -2096,76 +2161,6 @@ def cbk(prop, params, props, **kwargs): 'zhimi.aircondition.ma3': 'zhimi.aircondition.ma1', 'zhimi.aircondition.ma4': 'zhimi.aircondition.ma1', 'zhimi.aircondition.za1': 'zhimi.aircondition.ma1', - 'xiaomi.aircondition.ma2': { - 'chunk_properties': 1, - 'miio_specs': { - 'prop.2.1': {'prop': 'power', - 'setter': 'set_power', - 'template': '{{ value != 0 }}', - 'set_template': '{{ [value|int(1)] }}', - }, - 'prop.2.2': {'prop': 'mode', 'setter': 'set_mode', 'dict': { - 2: 1, - 3: 2, - 4: 3, - 5: 4, - }, 'default': 2}, - 'prop.2.3': { - 'prop': 'settemp', - 'setter': 'set_temp', - }, - 'prop.2.4': {'prop': 'energysave', - 'setter': 'set_energysave', - 'template': '{{ value != 0 }}', - 'set_template': '{{ [value|int(1)] }}', - }, - 'prop.2.5': {'prop': 'auxheat', - 'setter': 'set_auxheat', - 'template': '{{ value != 0 }}', - 'set_template': '{{ [value|int(1)] }}', - }, - 'prop.2.6': {'prop': 'sleep', - 'setter': 'set_sleep', - 'template': '{{ value != 0 }}', - 'set_template': '{{ [value|int(1)] }}', - }, - 'prop.2.7': {'prop': 'dry', - 'setter': 'set_dry', - 'template': '{{ value != 0 }}', - 'set_template': '{{ [value|int(1)] }}', - }, - 'prop.3.1': {'prop': 'wind_level', 'setter': 'set_wind_level', 'dict': { - 0: 0, #auto - 1: 1, - 2: 2, - 3: 3, - 4: 4, - 5: 5, - 6: 6, - 7: 7, - }}, - 'prop.3.2': {'prop': 'swing', - 'setter': 'set_swing', - 'template': '{{ value != 0 }}', - 'set_template': '{{ [value|int(1)] }}', - }, - 'prop.4.1': {'prop': 'temperature'}, - 'prop.5.1': {'prop': 'beep', - 'setter': 'set_beep', - 'template': '{{ value != 0 }}', - 'set_template': '{{ [value|int(1)] }}', - }, - 'prop.6.1': {'prop': 'light', - 'setter': 'set_light', - 'template': '{{ value != 0 }}', - 'set_template': '{{ [value|int(1)] }}', - }, - }, - }, - - 'xiaomi.aircondition.ma4': 'xiaomi.aircondition.ma2', - 'xiaomi.aircondition.ma6': 'xiaomi.aircondition.ma2', - 'zhimi.airmonitor.v1': { 'miio_specs': { 'prop.2.1': {'prop': 'aqi'},