Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring: Split Device class into Device+Protocol #592

Merged
merged 9 commits into from
Jan 13, 2020
3 changes: 2 additions & 1 deletion miio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
from miio.chuangmi_ir import ChuangmiIr
from miio.chuangmi_plug import ChuangmiPlug, Plug, PlugV1, PlugV3
from miio.cooker import Cooker
from miio.device import Device, DeviceError, DeviceException
from miio.device import Device
from miio.exceptions import DeviceError, DeviceException
from miio.fan import Fan, FanP5, FanSA1, FanV2, FanZA1, FanZA4
from miio.philips_bulb import PhilipsBulb, PhilipsWhiteBulb
from miio.philips_eyecare import PhilipsEyecare
Expand Down
3 changes: 2 additions & 1 deletion miio/airconditioningcompanion.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import click

from .click_common import EnumType, command, format_output
from .device import Device, DeviceException
from .device import Device
from .exceptions import DeviceException

_LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion miio/airdehumidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import click

from .click_common import EnumType, command, format_output
from .device import Device, DeviceError, DeviceException, DeviceInfo
from .device import Device, DeviceInfo
from .exceptions import DeviceError, DeviceException

_LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion miio/airfresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import click

from .click_common import EnumType, command, format_output
from .device import Device, DeviceException
from .device import Device
from .exceptions import DeviceException

_LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion miio/airfresh_t2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import click

from .click_common import EnumType, command, format_output
from .device import Device, DeviceException
from .device import Device
from .exceptions import DeviceException

_LOGGER = logging.getLogger(__name__)

Expand Down
5 changes: 3 additions & 2 deletions miio/airhumidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import click

from .click_common import EnumType, command, format_output
from .device import Device, DeviceError, DeviceException, DeviceInfo
from .device import Device, DeviceInfo
from .exceptions import DeviceError, DeviceException

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -119,7 +120,7 @@ def child_lock(self) -> bool:

@property
def target_humidity(self) -> int:
"""Target humiditiy. Can be either 30, 40, 50, 60, 70, 80 percent."""
"""Target humidity. Can be either 30, 40, 50, 60, 70, 80 percent."""
return self.data["limit_hum"]

@property
Expand Down
3 changes: 2 additions & 1 deletion miio/airhumidifier_mjjsq.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import click

from .click_common import EnumType, command, format_output
from .device import Device, DeviceException
from .device import Device
from .exceptions import DeviceException

_LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion miio/airpurifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import click

from .click_common import EnumType, command, format_output
from .device import Device, DeviceException
from .device import Device
from .exceptions import DeviceException

_LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion miio/airqualitymonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import click

from .click_common import command, format_output
from .device import Device, DeviceException
from .device import Device
from .exceptions import DeviceException

_LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion miio/aqaracamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import click

from .click_common import command, format_output
from .device import Device, DeviceException
from .device import Device
from .exceptions import DeviceException

_LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion miio/ceil.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import click

from .click_common import command, format_output
from .device import Device, DeviceException
from .device import Device
from .exceptions import DeviceException

_LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion miio/ceil_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import miio # noqa: E402
from miio.click_common import ExceptionHandlerGroup, validate_ip, validate_token
from miio.protocol import Protocol

_LOGGER = logging.getLogger(__name__)
pass_dev = click.make_pass_decorator(miio.Ceil)
Expand Down Expand Up @@ -65,7 +66,7 @@ def cli(ctx, ip: str, token: str, debug: int):
@cli.command()
def discover():
"""Search for plugs in the network."""
miio.Ceil.discover()
Protocol.discover()


@cli.command()
Expand Down
3 changes: 2 additions & 1 deletion miio/chuangmi_ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
)

from .click_common import command, format_output
from .device import Device, DeviceException
from .device import Device
from .exceptions import DeviceException


class ChuangmiIrException(DeviceException):
Expand Down
3 changes: 2 additions & 1 deletion miio/cooker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import click

from .click_common import command, format_output
from .device import Device, DeviceException
from .device import Device
from .exceptions import DeviceException

_LOGGER = logging.getLogger(__name__)

Expand Down
Loading