Skip to content

Commit

Permalink
deprecate Fan{V2,SA1,ZA1,ZA3,ZA4} in favor of model kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Aug 24, 2021
1 parent 75ac5fd commit 7bedd02
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions miio/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .click_common import EnumType, command, format_output
from .device import Device, DeviceStatus
from .fan_common import FanException, LedBrightness, MoveDirection, OperationMode
from .utils import deprecated

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -462,6 +463,7 @@ def delay_off(self, seconds: int):
return self.send("set_poweroff_time", [seconds])


@deprecated('use Fan(.., model="zhimi.fan.v2")')
class FanV2(Fan):
def __init__(
self,
Expand All @@ -474,6 +476,7 @@ def __init__(
super().__init__(ip, token, start_id, debug, lazy_discover, model=MODEL_FAN_V2)


@deprecated('use Fan(.., model="zhimi.fan.sa1")')
class FanSA1(Fan):
def __init__(
self,
Expand All @@ -486,6 +489,7 @@ def __init__(
super().__init__(ip, token, start_id, debug, lazy_discover, model=MODEL_FAN_SA1)


@deprecated('use Fan(.., model="zhimi.fan.za1")')
class FanZA1(Fan):
def __init__(
self,
Expand All @@ -498,6 +502,7 @@ def __init__(
super().__init__(ip, token, start_id, debug, lazy_discover, model=MODEL_FAN_ZA1)


@deprecated('use Fan(.., model="zhimi.fan.za3")')
class FanZA3(Fan):
def __init__(
self,
Expand All @@ -510,6 +515,7 @@ def __init__(
super().__init__(ip, token, start_id, debug, lazy_discover, model=MODEL_FAN_ZA3)


@deprecated('use Fan(.., model="zhimi.fan.za4")')
class FanZA4(Fan):
def __init__(
self,
Expand Down

0 comments on commit 7bedd02

Please sign in to comment.