Skip to content

Commit

Permalink
Move FanP9/FanP10/FanP11 to FanMiot (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
override80 authored Mar 8, 2022
1 parent b8be713 commit 5186ff3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions custom_components/xiaomi_miio_fan/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
Fan1C,
FanLeshow,
FanP5,
FanP9,
FanP10,
FanP11,
FanMiot
)
from miio.miot_device import MiotDevice, DeviceStatus
from miio.fan_common import (
Expand Down Expand Up @@ -417,17 +415,17 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
name, fan, model, unique_id, retries, preset_modes_override
)
elif model == MODEL_FAN_P9:
fan = FanP9(host, token, model=model)
fan = FanMiot(host, token, model=model)
device = XiaomiFanMiot(
name, fan, model, unique_id, retries, preset_modes_override
)
elif model in [MODEL_FAN_P10, MODEL_FAN_P18]:
fan = FanP10(host, token, model=MODEL_FAN_P10)
fan = FanMiot(host, token, model=MODEL_FAN_P10)
device = XiaomiFanMiot(
name, fan, model, unique_id, retries, preset_modes_override
)
elif model in [MODEL_FAN_P11, MODEL_FAN_P15]:
fan = FanP11(host, token, model=MODEL_FAN_P11)
fan = FanMiot(host, token, model=MODEL_FAN_P11)
device = XiaomiFanMiot(
name, fan, model, unique_id, retries, preset_modes_override
)
Expand Down

0 comments on commit 5186ff3

Please sign in to comment.