From 56eb1f74b7c00839d3bbfcc893732d50f19c7ff9 Mon Sep 17 00:00:00 2001 From: Alone Date: Thu, 21 Nov 2024 19:20:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8D=83=20add=20miio2miot=20for=20dmak?= =?UTF-8?q?er.airfresh.a1/t2017=20(#1965)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiaomi_miot/core/miio2miot_specs.py | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/custom_components/xiaomi_miot/core/miio2miot_specs.py b/custom_components/xiaomi_miot/core/miio2miot_specs.py index e0cc65be5..02bf2c7b5 100644 --- a/custom_components/xiaomi_miot/core/miio2miot_specs.py +++ b/custom_components/xiaomi_miot/core/miio2miot_specs.py @@ -376,6 +376,73 @@ def cbk(prop, params, props, **kwargs): }, }, + 'dmaker.airfresh.a1': { + # https://github.com/rytilahti/python-miio/blob/0.6.0.dev0/miio/integrations/dmaker/airfresh/airfresh_t2017.py#L73 + 'without_props': True, + 'miio_commands': [ + { + 'method': 'get_prop', + 'params': [ + 'power', 'mode', 'pm25', 'co2', 'temperature_outside', 'favourite_speed', 'control_speed', + 'ptc_on', 'ptc_status', 'child_lock', 'sound', 'display', 'filter_rate', 'filter_day', + ], + 'values': True, + }, + ], + 'miio_specs': { + 'prop.2.1': {'prop': 'power', 'setter': True}, + 'prop.2.2': {'prop': 'mode', 'setter': True, 'dict': { + 'auto': 0, + 'favourite': 1, + 'sleep': 2, + }}, + 'prop.2.3': {'prop': 'ptc_on', 'setter': True}, + 'prop.3.1': {'prop': 'pm25'}, + 'prop.3.2': {'prop': 'co2'}, + 'prop.4.1': {'prop': 'filter_rate'}, + 'prop.4.2': {'prop': 'filter_day'}, + 'prop.5.1': {'prop': 'child_lock', 'setter': True}, + 'prop.6.1': {'prop': 'sound', 'setter': True}, + 'prop.7.1': {'prop': 'favourite_speed', 'setter': True, 'dict': { + 60: 0, 80: 1, 100: 2, + 120: 3, 140: 4, 160: 5, 180: 6, 200: 7, + 220: 8, 240: 9, 260: 10, 280: 11, 300: 12, + }}, + 'prop.8.1': {'prop': 'display', 'setter': True}, + }, + }, + 'dmaker.airfresh.t2017': { + # https://github.com/rytilahti/python-miio/blob/0.6.0.dev0/miio/integrations/dmaker/airfresh/airfresh_t2017.py#L91 + 'extend_model': 'dmaker.airfresh.a1', + 'miio_commands': [ + { + 'method': 'get_prop', + 'params': [ + 'power', 'mode', 'pm25', 'co2', 'temperature_outside', 'favourite_speed', 'control_speed', + 'ptc_on', 'ptc_status', 'child_lock', 'sound', 'display', + 'filter_intermediate', 'filter_inter_day', 'filter_efficient', 'filter_effi_day', + 'ptc_level', 'screen_direction', + ], + 'values': True, + }, + ], + 'miio_specs': { + 'prop.2.4': {'prop': 'ptc_level', 'setter': True, 'dict': { + 'low': 1, + 'medium': 2, + 'high': 3, + }}, + 'prop.3.2': {'prop': 'temperature_outside'}, + 'prop.3.3': {'prop': 'co2'}, + 'prop.4.1': {'prop': 'filter_intermediate'}, + 'prop.4.2': {'prop': 'filter_inter_day'}, + 'prop.5.1': {'prop': 'filter_efficient'}, + 'prop.5.2': {'prop': 'filter_effi_day'}, + 'prop.6.1': {'prop': 'child_lock', 'setter': True}, + 'prop.8.1': {'prop': 'display', 'setter': True}, + 'prop.9.1': {'prop': 'sound', 'setter': True}, + }, + }, 'dmaker.fan.p5': { """ https://github.com/rytilahti/python-miio/blob/31c5d740d403c6f45f1e7e0d4a8a6276684a8ecd/miio/integrations/fan/dmaker/fan.py#L28 From 1e49372a80cb7f8ffccae3ab28ae5632bbeac651 Mon Sep 17 00:00:00 2001 From: Alone Date: Fri, 22 Nov 2024 18:44:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E2=AC=86=20new=20version=20v0.7.24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/xiaomi_miot/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/xiaomi_miot/manifest.json b/custom_components/xiaomi_miot/manifest.json index 62367fe36..74864bb1e 100644 --- a/custom_components/xiaomi_miot/manifest.json +++ b/custom_components/xiaomi_miot/manifest.json @@ -17,5 +17,5 @@ "python-miio>=0.5.12", "micloud>=0.5" ], - "version": "0.7.23" + "version": "0.7.24" }