From a735f9076247f38397ecbeb9190681104f708971 Mon Sep 17 00:00:00 2001 From: shengjianda Date: Sun, 3 May 2020 18:57:44 +0800 Subject: [PATCH] support some more devices Add device AqaraSwitchOneChannel (product QBKG11LM) and AqaraSwitchTwoChannels (product QBKG12LM). The new SensorHT (product WSDCGQ11LM) can get pressure. the Plug can get load_power. Have tested on my devices. --- miio/gateway.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/miio/gateway.py b/miio/gateway.py index ef5dbe58d..5241558fe 100644 --- a/miio/gateway.py +++ b/miio/gateway.py @@ -40,6 +40,8 @@ class DeviceType(IntEnum): AqaraSwitch = 51 AqaraMotion = 52 AqaraMagnet = 53 + AqaraSwitchOneChannel = 63 + AqaraSwitchTwoChannels = 64 class Gateway(Device): @@ -525,9 +527,17 @@ def __repr__(self): class SensorHT(SubDevice): accessor = "get_prop_sensor_ht" - properties = ["temperature", "humidity"] + properties = ["temperature", "humidity", "pressure"] class Plug(SubDevice): accessor = "get_prop_plug" - properties = ["power", "neutral_0"] + properties = ["power", "neutral_0", "load_power"] + + +class AqaraSwitchOneChannel(SubDevice): + properties = ["load_power", "neutral_0", "neutral_1"] + + +class AqaraSwitchTwoChannels(SubDevice): + properties = ["load_power", "neutral_0", "neutral_1"]