From 1460b0173379fd76facc5184e01a9c03aa55277a Mon Sep 17 00:00:00 2001 From: Reece King Date: Sun, 7 Jul 2024 10:05:08 +0100 Subject: [PATCH] Add dmaker.fan.p30 (Mi Smart Standing Fan 2 P30) support (#248) --- README.md | 41 ++++++++++++------------ custom_components/xiaomi_miio_fan/fan.py | 8 +++-- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index f54bce5..48cbb96 100644 --- a/README.md +++ b/README.md @@ -14,26 +14,27 @@ Credits: Thanks to [Rytilahti](https://github.com/rytilahti/python-miio) for all ## Supported devices -| Name | Model | Model no. | Specs | -| ----------------------- | ---------------------- | --------- | ----- | -| Pedestal Fan Fan V2 | zhimi.fan.v2 | | | -| Pedestal Fan Fan V3 | zhimi.fan.v3 | | | -| Pedestal Fan Fan SA1 | zhimi.fan.sa1 | | | -| Pedestal Fan Fan ZA1 | zhimi.fan.za1 | | | -| Pedestal Fan Fan ZA3 | zhimi.fan.za3 | | | -| Pedestal Fan Fan ZA4 | zhimi.fan.za4 | ZLBPLDS04ZM | | -| Smartmi Standing Fan 3 | zhimi.fan.za5 | | | -| Pedestal Fan Fan 1C | dmaker.fan.1c | | | -| Pedestal Fan Fan P5 | dmaker.fan.p5 | | | -| Pedestal Fan Fan P8 | dmaker.fan.p8 | | | -| Pedestal Fan Fan P9 | dmaker.fan.p9 | | | -| Pedestal Fan Fan P10 | dmaker.fan.p10 | | | -| Mijia Pedestal Fan | dmaker.fan.p11 | BPLDS03DM | 2800mAh, 24W, <=58dB | -| Smart Standing Fan 2 Pro| dmaker.fan.p33 | BPLDS03DM | 2800mAh, 24W, <=58dB | -| Pedestal Fan Fan P15 | dmaker.fan.p15 | | | -| Mi Smart Standing Fan 2 | dmaker.fan.p18 | BPLDS02DM | AC, 15W, 30.2-55.8bB | -| Rosou SS4 Ventilator | leshow.fan.ss4 | | | -| Xiaomi Smart Tower Fan | dmaker.fan.p39 | BPTS01DM | 22W, <=63dB | +| Name | Model | Model no. | Specs | +| ----------------------------| ---------------------- | --------- | ----- | +| Pedestal Fan Fan V2 | zhimi.fan.v2 | | | +| Pedestal Fan Fan V3 | zhimi.fan.v3 | | | +| Pedestal Fan Fan SA1 | zhimi.fan.sa1 | | | +| Pedestal Fan Fan ZA1 | zhimi.fan.za1 | | | +| Pedestal Fan Fan ZA3 | zhimi.fan.za3 | | | +| Pedestal Fan Fan ZA4 | zhimi.fan.za4 | ZLBPLDS04ZM | | +| Smartmi Standing Fan 3 | zhimi.fan.za5 | | | +| Pedestal Fan Fan 1C | dmaker.fan.1c | | | +| Pedestal Fan Fan P5 | dmaker.fan.p5 | | | +| Pedestal Fan Fan P8 | dmaker.fan.p8 | | | +| Pedestal Fan Fan P9 | dmaker.fan.p9 | | | +| Pedestal Fan Fan P10 | dmaker.fan.p10 | | | +| Mijia Pedestal Fan | dmaker.fan.p11 | BPLDS03DM | 2800mAh, 24W, <=58dB | +| Smart Standing Fan 2 Pro | dmaker.fan.p33 | BPLDS03DM | 2800mAh, 24W, <=58dB | +| Pedestal Fan Fan P15 | dmaker.fan.p15 | | | +| Mi Smart Standing Fan 2 P18 | dmaker.fan.p18 | BPLDS02DM | AC, 15W, 30.2-55.8bB | +| Mi Smart Standing Fan 2 P30 | dmaker.fan.p30 | BPLDS02DM | AC, 15W, 30.2-55.8bB | +| Rosou SS4 Ventilator | leshow.fan.ss4 | | | +| Xiaomi Smart Tower Fan | dmaker.fan.p39 | BPTS01DM | 22W, <=63dB | ## Features diff --git a/custom_components/xiaomi_miio_fan/fan.py b/custom_components/xiaomi_miio_fan/fan.py index c47b5f1..c1ada7e 100644 --- a/custom_components/xiaomi_miio_fan/fan.py +++ b/custom_components/xiaomi_miio_fan/fan.py @@ -74,7 +74,8 @@ MODEL_FAN_P10 = "dmaker.fan.p10" # Pedestal Fan Fan P10 MODEL_FAN_P11 = "dmaker.fan.p11" # Mijia Pedestal Fan MODEL_FAN_P15 = "dmaker.fan.p15" # Pedestal Fan Fan P15 -MODEL_FAN_P18 = "dmaker.fan.p18" # Mi Smart Standing Fan 2 +MODEL_FAN_P18 = "dmaker.fan.p18" # Mi Smart Standing Fan 2 P18 +MODEL_FAN_P30 = "dmaker.fan.p30" # Mi Smart Standing Fan 2 P30 MODEL_FAN_P33 = "dmaker.fan.p33" # Mi Smart Standing Fan Pro 2 MODEL_FAN_P39 = "dmaker.fan.p39" # Smart Tower Fan MODEL_FAN_LESHOW_SS4 = "leshow.fan.ss4" @@ -101,6 +102,7 @@ MODEL_FAN_P11, MODEL_FAN_P15, MODEL_FAN_P18, + MODEL_FAN_P30, MODEL_FAN_P33, MODEL_FAN_P39, MODEL_FAN_LESHOW_SS4, @@ -478,7 +480,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= device = XiaomiFanMiot( name, fan, model, unique_id, retries, preset_modes_override ) - elif model in [MODEL_FAN_P10, MODEL_FAN_P18]: + elif model in [MODEL_FAN_P10, MODEL_FAN_P18, MODEL_FAN_P30]: fan = FanMiot(host, token, model=MODEL_FAN_P10) device = XiaomiFanMiot( name, fan, model, unique_id, retries, preset_modes_override @@ -1072,7 +1074,7 @@ async def async_set_delay_off(self, delay_off_countdown: int) -> None: class XiaomiFanMiot(XiaomiFanP5): - """Representation of a Xiaomi Pedestal Fan P9, P10, P11, P18.""" + """Representation of a Xiaomi Pedestal Fan P9, P10, P11, P18, P30.""" pass