From 17e713a559bdb63d38b544cdb3769bfef9af85b1 Mon Sep 17 00:00:00 2001 From: Teemu R Date: Mon, 17 Jan 2022 00:40:01 +0100 Subject: [PATCH] Move leshow fan implementation to integrations/fan/leshow/ (#1305) * Move leshow fan implementation to integrations/fan/leshow/ * Move tests under tests/ --- miio/__init__.py | 5 +---- miio/integrations/fan/leshow/__init__.py | 2 ++ miio/{ => integrations/fan/leshow}/fan_leshow.py | 5 ++--- miio/integrations/fan/leshow/tests/__init__.py | 0 .../fan/leshow}/tests/test_fan_leshow.py | 8 ++++---- 5 files changed, 9 insertions(+), 11 deletions(-) create mode 100644 miio/integrations/fan/leshow/__init__.py rename miio/{ => integrations/fan/leshow}/fan_leshow.py (97%) create mode 100644 miio/integrations/fan/leshow/tests/__init__.py rename miio/{ => integrations/fan/leshow}/tests/test_fan_leshow.py (97%) diff --git a/miio/__init__.py b/miio/__init__.py index cf9abb412..c3595b536 100644 --- a/miio/__init__.py +++ b/miio/__init__.py @@ -38,12 +38,12 @@ from miio.chuangmi_plug import ChuangmiPlug, Plug, PlugV1, PlugV3 from miio.cooker import Cooker from miio.curtain_youpin import CurtainMiot -from miio.fan_leshow import FanLeshow from miio.gateway import Gateway from miio.heater import Heater from miio.heater_miot import HeaterMiot from miio.huizuo import Huizuo, HuizuoLampFan, HuizuoLampHeater, HuizuoLampScene from miio.integrations.fan.dmaker import Fan1C, FanMiot, FanP5, FanP9, FanP10, FanP11 +from miio.integrations.fan.leshow import FanLeshow from miio.integrations.fan.zhimi import Fan, FanZA5 from miio.integrations.light.philips import ( Ceil, @@ -80,9 +80,6 @@ from miio.wifispeaker import WifiSpeaker from miio.yeelight_dual_switch import YeelightDualControlModule -from .device import Device, DeviceStatus -from .miot_device import MiotDevice - from miio.discovery import Discovery __version__ = version("python-miio") diff --git a/miio/integrations/fan/leshow/__init__.py b/miio/integrations/fan/leshow/__init__.py new file mode 100644 index 000000000..73e79c0e9 --- /dev/null +++ b/miio/integrations/fan/leshow/__init__.py @@ -0,0 +1,2 @@ +# flake8: noqa +from .fan_leshow import FanLeshow diff --git a/miio/fan_leshow.py b/miio/integrations/fan/leshow/fan_leshow.py similarity index 97% rename from miio/fan_leshow.py rename to miio/integrations/fan/leshow/fan_leshow.py index 8e2fd3aa1..f529bd312 100644 --- a/miio/fan_leshow.py +++ b/miio/integrations/fan/leshow/fan_leshow.py @@ -4,9 +4,8 @@ import click -from .click_common import EnumType, command, format_output -from .device import Device, DeviceStatus -from .exceptions import DeviceException +from miio import Device, DeviceException, DeviceStatus +from miio.click_common import EnumType, command, format_output _LOGGER = logging.getLogger(__name__) diff --git a/miio/integrations/fan/leshow/tests/__init__.py b/miio/integrations/fan/leshow/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/miio/tests/test_fan_leshow.py b/miio/integrations/fan/leshow/tests/test_fan_leshow.py similarity index 97% rename from miio/tests/test_fan_leshow.py rename to miio/integrations/fan/leshow/tests/test_fan_leshow.py index 2f767137c..d8e5fa409 100644 --- a/miio/tests/test_fan_leshow.py +++ b/miio/integrations/fan/leshow/tests/test_fan_leshow.py @@ -2,16 +2,16 @@ import pytest -from miio import FanLeshow -from miio.fan_leshow import ( +from miio.tests.dummies import DummyDevice + +from ..fan_leshow import ( MODEL_FAN_LESHOW_SS4, + FanLeshow, FanLeshowException, FanLeshowStatus, OperationMode, ) -from .dummies import DummyDevice - class DummyFanLeshow(DummyDevice, FanLeshow): def __init__(self, *args, **kwargs):