Skip to content

Commit

Permalink
Merge branch 'release/0.6.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Apr 11, 2021
2 parents c7a6aae + 427bc0b commit 422c3b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 12 additions & 4 deletions custom_components/xiaomi_miio_airpurifier/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 422c3b4

Please sign in to comment.