From 7aa20a2c768c3d219ecb015d1a2139e2f3b65940 Mon Sep 17 00:00:00 2001 From: Alone Date: Tue, 10 Sep 2024 18:15:41 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=83=20add=20miio2miot=20for=20airdog.a?= =?UTF-8?q?irpurifier.x5/x7/x7sm=20(#1842)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiaomi_miot/core/miio2miot_specs.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/custom_components/xiaomi_miot/core/miio2miot_specs.py b/custom_components/xiaomi_miot/core/miio2miot_specs.py index 3155f814e..03a75f70d 100644 --- a/custom_components/xiaomi_miot/core/miio2miot_specs.py +++ b/custom_components/xiaomi_miot/core/miio2miot_specs.py @@ -112,6 +112,39 @@ def cbk(prop, params, props, **kwargs): }, }, + 'airdog.airpurifier.x5': { + 'without_props': True, + 'ignore_result': True, + 'miio_commands': [ + { + 'method': 'get_prop', + 'values': ['power', 'mode', 'speed', 'lock', 'clean', 'pm25'], + }, + ], + 'miio_specs': { + 'prop.2.1': {'prop': 'power', 'setter': True, 'format': 'onoff', 'set_template': '{{ [value|int] }}'}, + 'prop.2.2': {'prop': 'speed', 'setter': 'set_wind', 'set_template': '{{ [props.mode, value|int] }}'}, + 'prop.2.3': {'prop': 'mode', 'setter': 'set_wind', 'set_template': '{{ [value|int, props.speed] }}'}, + 'prop.3.1': {'prop': 'pm25'}, + 'prop.4.1': { + 'prop': 'lock', 'setter': True, + 'template': '{{ value in ["lock"] }}', + 'set_template': '{{ [value|int] }}', + }, + }, + }, + 'airdog.airpurifier.x7': 'airdog.airpurifier.x5', + 'airdog.airpurifier.x7sm': { + 'extend_model': 'airdog.airpurifier.x5', + 'entity_attrs': ['hcho'], + 'miio_commands': [ + { + 'method': 'get_prop', + 'values': ['power', 'mode', 'speed', 'lock', 'clean', 'pm25', 'hcho'], + }, + ], + }, + 'bj352.waterpuri.s100cm': { 'without_props': True, 'entity_attrs': ['PureWasteRatio', 'HeatingStatus', 'TotalPureWater', 'TotalWasteWater', 'error_code'],