diff --git a/README.md b/README.md index b7305fe..e545d1f 100644 --- a/README.md +++ b/README.md @@ -494,7 +494,7 @@ This paragraph was moved to [docs/dmaker-airfresh-t2017.md](docs/dmaker-airfresh * Power (on, off) * Speed levels (Level 1, Level 2, Level 3, Level 4) * Oscillate (on, off) -* Oscillation angle (30, 60, 90, 120) +* Oscillation angle (30, 60, 90, 120, 140, 150) * Natural mode (on, off) * Rotate by 5 degrees (left, right) * Child lock (on, off) diff --git a/custom_components/xiaomi_miio_airpurifier/fan.py b/custom_components/xiaomi_miio_airpurifier/fan.py index 3f2fdb6..5fb9c44 100644 --- a/custom_components/xiaomi_miio_airpurifier/fan.py +++ b/custom_components/xiaomi_miio_airpurifier/fan.py @@ -18,8 +18,10 @@ DeviceException, Fan, FanLeshow, - FanMiot, FanP5, + FanP9, + FanP10, + FanP11, ) from miio.airfresh import ( # pylint: disable=import-error, import-error LedBrightness as AirfreshLedBrightness, @@ -901,7 +903,7 @@ ) SERVICE_SCHEMA_OSCILLATION_ANGLE = AIRPURIFIER_SERVICE_SCHEMA.extend( - {vol.Required(ATTR_ANGLE): vol.All(vol.Coerce(int), vol.In([30, 60, 90, 120]))} + {vol.Required(ATTR_ANGLE): cv.positive_int} ) SERVICE_SCHEMA_DELAY_OFF = AIRPURIFIER_SERVICE_SCHEMA.extend( @@ -1057,8 +1059,14 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= elif model == MODEL_FAN_P5: fan = FanP5(host, token, model=model) device = XiaomiFanP5(name, fan, model, unique_id, retries) - elif model in [MODEL_FAN_P9, MODEL_FAN_P10, MODEL_FAN_P11]: - fan = FanMiot(host, token, model=model) + elif model == MODEL_FAN_P9: + fan = FanP9(host, token, model=model) + device = XiaomiFanMiot(name, fan, model, unique_id, retries) + elif model == MODEL_FAN_P10: + fan = FanP10(host, token, model=model) + device = XiaomiFanMiot(name, fan, model, unique_id, retries) + elif model == MODEL_FAN_P11: + fan = FanP11(host, token, model=model) device = XiaomiFanMiot(name, fan, model, unique_id, retries) elif model == MODEL_FAN_LESHOW_SS4: fan = FanLeshow(host, token, model=model)