diff --git a/README.md b/README.md index f8412c15e..d5190fc22 100644 --- a/README.md +++ b/README.md @@ -267,7 +267,7 @@ integration, this library supports also the following devices: * Xiaomi Philips Zhirui Bedroom Smart Lamp * Huayi Huizuo Lamps * Xiaomi Universal IR Remote Controller (Chuangmi IR) -* Xiaomi Mi Smart Pedestal Fan V2, V3, SA1, ZA1, ZA3, ZA4, ZA5 1C, P5, P9, P10, P11, P15, P18, P33 +* Xiaomi Mi Smart Pedestal Fan V2, V3, SA1, ZA1, ZA3, ZA4, ZA5 1C, P5, P9, P10, P11, P15, P18, P33, P39 * Xiaomi Rosou SS4 Ventilator (leshow.fan.ss4) * Xiaomi Mi Air Humidifier V1, CA1, CA4, CB1, MJJSQ, JSQ, JSQ1, JSQ001 * Xiaomi Mi Water Purifier (Basic support: Turn on & off) diff --git a/miio/integrations/dmaker/fan/fan_miot.py b/miio/integrations/dmaker/fan/fan_miot.py index 72da0ed21..847e91e24 100644 --- a/miio/integrations/dmaker/fan/fan_miot.py +++ b/miio/integrations/dmaker/fan/fan_miot.py @@ -23,6 +23,7 @@ class MoveDirection(enum.Enum): MODEL_FAN_P15 = "dmaker.fan.p15" MODEL_FAN_P18 = "dmaker.fan.p18" MODEL_FAN_P33 = "dmaker.fan.p33" +MODEL_FAN_P39 = "dmaker.fan.p39" MODEL_FAN_1C = "dmaker.fan.1c" @@ -85,9 +86,23 @@ class MoveDirection(enum.Enum): "power_off_time": {"siid": 3, "piid": 1}, "set_move": {"siid": 6, "piid": 1}, }, + MODEL_FAN_P39: { + # Source https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:fan:0000A005:dmaker-p39:1 + "power": {"siid": 2, "piid": 1}, + "fan_level": {"siid": 2, "piid": 2}, + "mode": {"siid": 2, "piid": 4}, + "swing_mode": {"siid": 2, "piid": 5}, + "swing_mode_angle": {"siid": 2, "piid": 6}, + "fan_speed": {"siid": 2, "piid": 11}, + "light": {"siid": 2, "piid": 9}, + "buzzer": {"siid": 2, "piid": 7}, + # "device_fault": {"siid": 6, "piid": 2}, + "child_lock": {"siid": 3, "piid": 1}, + "power_off_time": {"siid": 2, "piid": 8}, + "set_move": {"siid": 2, "piid": 10}, + }, } - # These mappings are based on user reports and may not cover all features MIOT_MAPPING[MODEL_FAN_P15] = MIOT_MAPPING[MODEL_FAN_P11] # see #1354 MIOT_MAPPING[MODEL_FAN_P18] = MIOT_MAPPING[MODEL_FAN_P10] # see #1341