From f5547d7c8a42f349de937e59e23a3293d818e440 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sun, 1 Apr 2018 09:09:47 +0200 Subject: [PATCH] Revert "Optimize imports" This reverts commit 91dc4d74af962974aa46dc14dfe8fc6b35449437. --- miio/__init__.py | 28 ++++++++++----------- miio/airconditioningcompanion.py | 3 +-- miio/airhumidifier.py | 10 +++----- miio/airpurifier.py | 8 +++--- miio/airqualitymonitor.py | 3 +-- miio/ceil.py | 8 +++--- miio/ceil_cli.py | 9 +++---- miio/chuangmi_ir.py | 4 +-- miio/chuangmi_plug.py | 8 +++--- miio/cli.py | 2 -- miio/device.py | 15 ++++++----- miio/discovery.py | 18 ++++++------- miio/extract_tokens.py | 11 ++++---- miio/philips_eyecare_cli.py | 9 +++---- miio/plug_cli.py | 11 ++++---- miio/protocol.py | 10 +++++--- miio/tests/test_airconditioningcompanion.py | 10 +++----- miio/tests/test_airhumidifier.py | 6 ++--- miio/tests/test_airpurifier.py | 7 ++---- miio/tests/test_airqualitymonitor.py | 4 +-- miio/tests/test_ceil.py | 4 +-- miio/tests/test_chuangmi_ir.py | 10 +++----- miio/tests/test_chuangmi_plug.py | 7 ++---- miio/tests/test_philips_bulb.py | 4 +-- miio/tests/test_philips_eyecare.py | 4 +-- miio/tests/test_powerstrip.py | 4 +-- miio/tests/test_protocol.py | 3 +-- miio/tests/test_vacuum.py | 6 ++--- miio/tests/test_waterpurifier.py | 4 +-- miio/tests/test_wifirepeater.py | 4 +-- miio/tests/test_yeelight.py | 4 +-- miio/updater.py | 2 +- miio/utils.py | 2 +- miio/vacuum.py | 24 ++++++++---------- miio/vacuum_cli.py | 20 +++++++-------- miio/vacuumcontainers.py | 3 +-- miio/wifispeaker.py | 3 +-- miio/yeelight.py | 5 ++-- mirobo/__init__.py | 1 + 39 files changed, 121 insertions(+), 177 deletions(-) diff --git a/miio/__init__.py b/miio/__init__.py index cdbe275f4..e97c9e430 100644 --- a/miio/__init__.py +++ b/miio/__init__.py @@ -1,22 +1,22 @@ # flake8: noqa -from miio.airconditioningcompanion import AirConditioningCompanion -from miio.airhumidifier import AirHumidifier +from miio.protocol import Message, Utils +from miio.vacuumcontainers import (VacuumStatus, ConsumableStatus, DNDStatus, + CleaningDetails, CleaningSummary, Timer) +from miio.vacuum import Vacuum, VacuumException +from miio.chuangmi_plug import (Plug, PlugV1, PlugV3, ChuangmiPlug) from miio.airpurifier import AirPurifier -from miio.airqualitymonitor import AirQualityMonitor +from miio.airhumidifier import AirHumidifier +from miio.waterpurifier import WaterPurifier +from miio.powerstrip import PowerStrip from miio.ceil import Ceil -from miio.chuangmi_ir import ChuangmiIr -from miio.chuangmi_plug import (Plug, PlugV1, PlugV3, ChuangmiPlug) -from miio.device import Device, DeviceException -from miio.fan import Fan from miio.philips_bulb import PhilipsBulb from miio.philips_eyecare import PhilipsEyecare -from miio.powerstrip import PowerStrip -from miio.protocol import Message, Utils -from miio.vacuum import Vacuum, VacuumException -from miio.vacuumcontainers import (VacuumStatus, ConsumableStatus, DNDStatus, - CleaningDetails, CleaningSummary, Timer, ) -from miio.waterpurifier import WaterPurifier -from miio.wifirepeater import WifiRepeater +from miio.chuangmi_ir import ChuangmiIr +from miio.fan import Fan from miio.wifispeaker import WifiSpeaker +from miio.wifirepeater import WifiRepeater +from miio.airqualitymonitor import AirQualityMonitor +from miio.airconditioningcompanion import AirConditioningCompanion from miio.yeelight import Yeelight +from miio.device import Device, DeviceException from miio.discovery import Discovery diff --git a/miio/airconditioningcompanion.py b/miio/airconditioningcompanion.py index b74ebfefd..eee5ac727 100644 --- a/miio/airconditioningcompanion.py +++ b/miio/airconditioningcompanion.py @@ -1,8 +1,7 @@ +from .device import Device import enum from typing import Optional -from .device import Device - class OperationMode(enum.Enum): Heat = 0 diff --git a/miio/airhumidifier.py b/miio/airhumidifier.py index f1e02c650..13437b10c 100644 --- a/miio/airhumidifier.py +++ b/miio/airhumidifier.py @@ -1,12 +1,10 @@ -import enum import logging -from collections import defaultdict -from typing import Any, Dict, Optional - +import enum import click - -from .click_common import command, format_output, EnumType +from typing import Any, Dict, Optional +from collections import defaultdict from .device import Device, DeviceException +from .click_common import command, format_output, EnumType _LOGGER = logging.getLogger(__name__) diff --git a/miio/airpurifier.py b/miio/airpurifier.py index 4001f85b6..266202717 100644 --- a/miio/airpurifier.py +++ b/miio/airpurifier.py @@ -1,13 +1,11 @@ -import enum import logging +import enum import re -from collections import defaultdict from typing import Any, Dict, Optional - +from collections import defaultdict import click - -from .click_common import command, format_output, EnumType from .device import Device, DeviceException +from .click_common import command, format_output, EnumType _LOGGER = logging.getLogger(__name__) diff --git a/miio/airqualitymonitor.py b/miio/airqualitymonitor.py index 3c0350364..f499e328b 100644 --- a/miio/airqualitymonitor.py +++ b/miio/airqualitymonitor.py @@ -1,8 +1,7 @@ import logging from collections import defaultdict - -from .click_common import command, format_output from .device import Device +from .click_common import command, format_output _LOGGER = logging.getLogger(__name__) diff --git a/miio/ceil.py b/miio/ceil.py index 10053de4d..813cb8a27 100644 --- a/miio/ceil.py +++ b/miio/ceil.py @@ -1,11 +1,9 @@ import logging -from collections import defaultdict -from typing import Any, Dict - import click - -from .click_common import command, format_output +from typing import Any, Dict +from collections import defaultdict from .device import Device, DeviceException +from .click_common import command, format_output _LOGGER = logging.getLogger(__name__) diff --git a/miio/ceil_cli.py b/miio/ceil_cli.py index a53a47aeb..8c0177bec 100644 --- a/miio/ceil_cli.py +++ b/miio/ceil_cli.py @@ -1,12 +1,11 @@ # -*- coding: UTF-8 -*- import logging -import sys - import click - -import miio # noqa: E402 +import sys from miio.click_common import (ExceptionHandlerGroup, validate_ip, - validate_token, ) + validate_token) +import miio # noqa: E402 + _LOGGER = logging.getLogger(__name__) pass_dev = click.make_pass_decorator(miio.Ceil) diff --git a/miio/chuangmi_ir.py b/miio/chuangmi_ir.py index be879e4ce..a8a68ed02 100644 --- a/miio/chuangmi_ir.py +++ b/miio/chuangmi_ir.py @@ -1,14 +1,12 @@ import base64 import re - import click from construct import ( Struct, Const, Rebuild, this, len_, Adapter, Computed, Int16ul, Int32ul, Int16ub, Array, BitStruct, BitsInteger, ) - -from .click_common import command, format_output from .device import Device, DeviceException +from .click_common import command, format_output class ChuangmiIrException(DeviceException): diff --git a/miio/chuangmi_plug.py b/miio/chuangmi_plug.py index a7de46c19..f1ad78229 100644 --- a/miio/chuangmi_plug.py +++ b/miio/chuangmi_plug.py @@ -1,12 +1,10 @@ import logging -from collections import defaultdict -from typing import Dict, Any, Optional - import click - -from .click_common import command, format_output +from typing import Dict, Any, Optional +from collections import defaultdict from .device import Device from .utils import deprecated +from .click_common import command, format_output _LOGGER = logging.getLogger(__name__) diff --git a/miio/cli.py b/miio/cli.py index 3e8cc02a5..04ddb662a 100644 --- a/miio/cli.py +++ b/miio/cli.py @@ -1,8 +1,6 @@ # -*- coding: UTF-8 -*- import logging - import click - from miio.click_common import ( ExceptionHandlerGroup, DeviceGroupMeta, GlobalContextObject, json_output, diff --git a/miio/device.py b/miio/device.py index 8cda0477f..0a0dd0383 100644 --- a/miio/device.py +++ b/miio/device.py @@ -1,19 +1,18 @@ -import binascii import codecs import datetime -import logging import socket -from enum import Enum -from typing import Any, List, Optional # noqa: F401 - -import click +import logging import construct +import binascii +import click +from typing import Any, List, Optional # noqa: F401 +from enum import Enum from .click_common import ( - DeviceGroupMeta, command, format_output, + DeviceGroupMeta, command, format_output ) -from .exceptions import DeviceException, DeviceError from .protocol import Message +from .exceptions import DeviceException, DeviceError _LOGGER = logging.getLogger(__name__) diff --git a/miio/discovery.py b/miio/discovery.py index 15f9c6f85..ebc8262f8 100644 --- a/miio/discovery.py +++ b/miio/discovery.py @@ -1,17 +1,17 @@ -import codecs -import inspect -import ipaddress import logging -from functools import partial -from typing import Union, Callable, Dict, Optional # noqa: F401 - import zeroconf - +import ipaddress +import inspect +import codecs from . import (Device, Vacuum, ChuangmiPlug, PowerStrip, AirPurifier, Ceil, PhilipsBulb, PhilipsEyecare, ChuangmiIr, AirHumidifier, - WaterPurifier, WifiSpeaker, WifiRepeater, Yeelight, ) + WaterPurifier, WifiSpeaker, WifiRepeater, Yeelight) from .chuangmi_plug import (MODEL_CHUANGMI_PLUG_V1, MODEL_CHUANGMI_PLUG_V3, - MODEL_CHUANGMI_PLUG_M1, ) + MODEL_CHUANGMI_PLUG_M1) + +from functools import partial +from typing import Union, Callable, Dict, Optional # noqa: F401 + _LOGGER = logging.getLogger(__name__) diff --git a/miio/extract_tokens.py b/miio/extract_tokens.py index 7e2a1ce0e..661637dae 100644 --- a/miio/extract_tokens.py +++ b/miio/extract_tokens.py @@ -1,14 +1,13 @@ import logging -import sqlite3 +import click import tempfile +import sqlite3 +from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes +from cryptography.hazmat.backends import default_backend from pprint import pformat as pf -from typing import Iterator - import attr -import click from android_backup import AndroidBackup -from cryptography.hazmat.backends import default_backend -from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes +from typing import Iterator logging.basicConfig(level=logging.INFO) _LOGGER = logging.getLogger(__name__) diff --git a/miio/philips_eyecare_cli.py b/miio/philips_eyecare_cli.py index e985f4b06..0dbd988e1 100644 --- a/miio/philips_eyecare_cli.py +++ b/miio/philips_eyecare_cli.py @@ -1,12 +1,11 @@ # -*- coding: UTF-8 -*- import logging -import sys - import click - -import miio # noqa: E402 +import sys from miio.click_common import (ExceptionHandlerGroup, validate_ip, - validate_token, ) + validate_token) +import miio # noqa: E402 + _LOGGER = logging.getLogger(__name__) pass_dev = click.make_pass_decorator(miio.PhilipsEyecare) diff --git a/miio/plug_cli.py b/miio/plug_cli.py index 12a1129ad..2564a71d8 100644 --- a/miio/plug_cli.py +++ b/miio/plug_cli.py @@ -1,14 +1,13 @@ # -*- coding: UTF-8 -*- -import ast import logging +import click +import ast import sys from typing import Any # noqa: F401 - -import click - -import miio # noqa: E402 from miio.click_common import (ExceptionHandlerGroup, validate_ip, - validate_token, ) + validate_token) +import miio # noqa: E402 + _LOGGER = logging.getLogger(__name__) pass_dev = click.make_pass_decorator(miio.Plug) diff --git a/miio/protocol.py b/miio/protocol.py index db0ddfb91..09f9ad773 100644 --- a/miio/protocol.py +++ b/miio/protocol.py @@ -10,20 +10,22 @@ An usage example can be seen in the source of :func:`miio.Device.send`. """ -import calendar import datetime import hashlib import json import logging +import calendar from typing import Any, Dict, Tuple +from pprint import pprint as pp # noqa: F401 -import construct from construct import (Struct, Bytes, Const, Int16ub, Int32ub, GreedyBytes, Adapter, Checksum, RawCopy, Rebuild, IfThenElse, - Default, Pointer, Hex, ) + Default, Pointer, Hex, Probe) +import construct + +from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import padding -from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes _LOGGER = logging.getLogger(__name__) diff --git a/miio/tests/test_airconditioningcompanion.py b/miio/tests/test_airconditioningcompanion.py index 078aee2f0..c9b2cdb65 100644 --- a/miio/tests/test_airconditioningcompanion.py +++ b/miio/tests/test_airconditioningcompanion.py @@ -1,13 +1,9 @@ import string from unittest import TestCase - -import pytest - from miio import AirConditioningCompanion -from miio.airconditioningcompanion import (OperationMode, FanSpeed, Power, - SwingMode, Led, - AirConditioningCompanionStatus, - STORAGE_SLOT_ID, ) +from miio.airconditioningcompanion import (OperationMode, FanSpeed, Power, SwingMode, Led, + AirConditioningCompanionStatus, STORAGE_SLOT_ID, ) +import pytest STATE_ON = ['on'] STATE_OFF = ['off'] diff --git a/miio/tests/test_airhumidifier.py b/miio/tests/test_airhumidifier.py index 321c79eee..5e74ff369 100644 --- a/miio/tests/test_airhumidifier.py +++ b/miio/tests/test_airhumidifier.py @@ -1,11 +1,9 @@ from unittest import TestCase - -import pytest - from miio import AirHumidifier from miio.airhumidifier import (OperationMode, LedBrightness, - AirHumidifierStatus, AirHumidifierException, ) + AirHumidifierStatus, AirHumidifierException) from .dummies import DummyDevice +import pytest class DummyAirHumidifier(DummyDevice, AirHumidifier): diff --git a/miio/tests/test_airpurifier.py b/miio/tests/test_airpurifier.py index 82d594b62..c3d04e7d2 100644 --- a/miio/tests/test_airpurifier.py +++ b/miio/tests/test_airpurifier.py @@ -1,12 +1,9 @@ from unittest import TestCase - -import pytest - from miio import AirPurifier from miio.airpurifier import (OperationMode, LedBrightness, FilterType, - SleepMode, AirPurifierStatus, - AirPurifierException, ) + SleepMode, AirPurifierStatus, AirPurifierException) from .dummies import DummyDevice +import pytest class DummyAirPurifier(DummyDevice, AirPurifier): diff --git a/miio/tests/test_airqualitymonitor.py b/miio/tests/test_airqualitymonitor.py index a282b260c..20c41f9c3 100644 --- a/miio/tests/test_airqualitymonitor.py +++ b/miio/tests/test_airqualitymonitor.py @@ -1,10 +1,8 @@ from unittest import TestCase - -import pytest - from miio import AirQualityMonitor from miio.airqualitymonitor import AirQualityMonitorStatus from .dummies import DummyDevice +import pytest class DummyAirQualityMonitor(DummyDevice, AirQualityMonitor): diff --git a/miio/tests/test_ceil.py b/miio/tests/test_ceil.py index 5cc7eea0b..d8f6de894 100644 --- a/miio/tests/test_ceil.py +++ b/miio/tests/test_ceil.py @@ -1,10 +1,8 @@ from unittest import TestCase - -import pytest - from miio import Ceil from miio.ceil import CeilStatus, CeilException from .dummies import DummyDevice +import pytest class DummyCeil(DummyDevice, Ceil): diff --git a/miio/tests/test_chuangmi_ir.py b/miio/tests/test_chuangmi_ir.py index 2acb96532..6b6105685 100644 --- a/miio/tests/test_chuangmi_ir.py +++ b/miio/tests/test_chuangmi_ir.py @@ -1,13 +1,11 @@ -import base64 -import json -import os from unittest import TestCase - -import pytest - from miio import ChuangmiIr from miio.chuangmi_ir import ChuangmiIrException from .dummies import DummyDevice +import pytest +import base64 +import json +import os with open(os.path.join( os.path.dirname(__file__), 'test_chuangmi_ir.json')) as inp: diff --git a/miio/tests/test_chuangmi_plug.py b/miio/tests/test_chuangmi_plug.py index dd922ffc0..b042b457e 100644 --- a/miio/tests/test_chuangmi_plug.py +++ b/miio/tests/test_chuangmi_plug.py @@ -1,12 +1,9 @@ from unittest import TestCase - -import pytest - from miio import ChuangmiPlug from miio.chuangmi_plug import (ChuangmiPlugStatus, MODEL_CHUANGMI_PLUG_V1, - MODEL_CHUANGMI_PLUG_V3, - MODEL_CHUANGMI_PLUG_M1, ) + MODEL_CHUANGMI_PLUG_V3, MODEL_CHUANGMI_PLUG_M1) from .dummies import DummyDevice +import pytest class DummyChuangmiPlugV1(DummyDevice, ChuangmiPlug): diff --git a/miio/tests/test_philips_bulb.py b/miio/tests/test_philips_bulb.py index 26f839051..6d6dc5adf 100644 --- a/miio/tests/test_philips_bulb.py +++ b/miio/tests/test_philips_bulb.py @@ -1,10 +1,8 @@ from unittest import TestCase - -import pytest - from miio import PhilipsBulb from miio.philips_bulb import PhilipsBulbStatus, PhilipsBulbException from .dummies import DummyDevice +import pytest class DummyPhilipsBulb(DummyDevice, PhilipsBulb): diff --git a/miio/tests/test_philips_eyecare.py b/miio/tests/test_philips_eyecare.py index 0ad9c41d8..b986e15c9 100644 --- a/miio/tests/test_philips_eyecare.py +++ b/miio/tests/test_philips_eyecare.py @@ -1,10 +1,8 @@ from unittest import TestCase - -import pytest - from miio import PhilipsEyecare from miio.philips_eyecare import PhilipsEyecareStatus, PhilipsEyecareException from .dummies import DummyDevice +import pytest class DummyPhilipsEyecare(DummyDevice, PhilipsEyecare): diff --git a/miio/tests/test_powerstrip.py b/miio/tests/test_powerstrip.py index faabe5112..03b61b4f1 100644 --- a/miio/tests/test_powerstrip.py +++ b/miio/tests/test_powerstrip.py @@ -1,10 +1,8 @@ from unittest import TestCase - -import pytest - from miio import PowerStrip from miio.powerstrip import PowerMode, PowerStripStatus, PowerStripException from .dummies import DummyDevice +import pytest class DummyPowerStrip(DummyDevice, PowerStrip): diff --git a/miio/tests/test_protocol.py b/miio/tests/test_protocol.py index 87c3e2af1..fcebcf0f2 100644 --- a/miio/tests/test_protocol.py +++ b/miio/tests/test_protocol.py @@ -1,8 +1,7 @@ -import binascii from unittest import TestCase - from .. import Utils from ..protocol import Message +import binascii class TestProtocol(TestCase): diff --git a/miio/tests/test_vacuum.py b/miio/tests/test_vacuum.py index 496e77287..e0a7c2669 100644 --- a/miio/tests/test_vacuum.py +++ b/miio/tests/test_vacuum.py @@ -1,10 +1,8 @@ -import datetime from unittest import TestCase - import pytest - -from miio import Vacuum, VacuumStatus from .dummies import DummyDevice +import datetime +from miio import Vacuum, VacuumStatus, VacuumException class DummyVacuum(DummyDevice, Vacuum): diff --git a/miio/tests/test_waterpurifier.py b/miio/tests/test_waterpurifier.py index ff5c38741..3467859a5 100644 --- a/miio/tests/test_waterpurifier.py +++ b/miio/tests/test_waterpurifier.py @@ -1,10 +1,8 @@ from unittest import TestCase - -import pytest - from miio import WaterPurifier from miio.waterpurifier import WaterPurifierStatus from .dummies import DummyDevice +import pytest class DummyWaterPurifier(DummyDevice, WaterPurifier): diff --git a/miio/tests/test_wifirepeater.py b/miio/tests/test_wifirepeater.py index fd2cd152c..2ec42b907 100644 --- a/miio/tests/test_wifirepeater.py +++ b/miio/tests/test_wifirepeater.py @@ -1,9 +1,7 @@ from unittest import TestCase - -import pytest - from miio import WifiRepeater from miio.wifirepeater import WifiRepeaterConfiguration, WifiRepeaterStatus +import pytest class DummyWifiRepeater(WifiRepeater): diff --git a/miio/tests/test_yeelight.py b/miio/tests/test_yeelight.py index 922bc66b4..2af70f362 100644 --- a/miio/tests/test_yeelight.py +++ b/miio/tests/test_yeelight.py @@ -1,9 +1,7 @@ from unittest import TestCase - -import pytest - from miio import Yeelight from miio.yeelight import YeelightMode, YeelightStatus, YeelightException +import pytest from .dummies import DummyDevice diff --git a/miio/updater.py b/miio/updater.py index a22988d04..649c32e03 100644 --- a/miio/updater.py +++ b/miio/updater.py @@ -1,7 +1,7 @@ +from http.server import HTTPServer, BaseHTTPRequestHandler import hashlib import logging import netifaces -from http.server import HTTPServer, BaseHTTPRequestHandler from os.path import basename _LOGGER = logging.getLogger(__name__) diff --git a/miio/utils.py b/miio/utils.py index b526fdbcf..85d3cc5be 100644 --- a/miio/utils.py +++ b/miio/utils.py @@ -1,5 +1,5 @@ -import functools import inspect +import functools import warnings from datetime import timedelta, datetime diff --git a/miio/vacuum.py b/miio/vacuum.py index 88a8632fa..125499456 100644 --- a/miio/vacuum.py +++ b/miio/vacuum.py @@ -1,24 +1,22 @@ -import datetime -import enum -import json import logging -import math import os -import pathlib +import math import time from typing import List - -import click +import enum +import datetime +import json +import pathlib import pytz +import click from appdirs import user_cache_dir - -from .click_common import ( - DeviceGroup, command, GlobalContextObject, -) -from .device import Device, DeviceException from .vacuumcontainers import (VacuumStatus, ConsumableStatus, DNDStatus, CleaningSummary, CleaningDetails, Timer, - SoundStatus, SoundInstallStatus, ) + SoundStatus, SoundInstallStatus) +from .device import Device, DeviceException +from .click_common import ( + DeviceGroup, command, GlobalContextObject +) _LOGGER = logging.getLogger(__name__) diff --git a/miio/vacuum_cli.py b/miio/vacuum_cli.py index ecb56dac4..db71af9cb 100644 --- a/miio/vacuum_cli.py +++ b/miio/vacuum_cli.py @@ -1,24 +1,22 @@ # -*- coding: UTF-8 -*- +import logging +import click +import pretty_cron import ast +import sys import json -import logging +import time import pathlib -import sys import threading -import time +from tqdm import tqdm +from appdirs import user_cache_dir from pprint import pformat as pf from typing import Any # noqa: F401 - -import click -import pretty_cron -from appdirs import user_cache_dir -from tqdm import tqdm - -import miio # noqa: E402 from miio.click_common import (ExceptionHandlerGroup, validate_ip, - validate_token, ) + validate_token) from .device import UpdateState from .updater import OneShotServer +import miio # noqa: E402 _LOGGER = logging.getLogger(__name__) pass_dev = click.make_pass_decorator(miio.Device, ensure=True) diff --git a/miio/vacuumcontainers.py b/miio/vacuumcontainers.py index 61ea6be0b..a6335b55f 100644 --- a/miio/vacuumcontainers.py +++ b/miio/vacuumcontainers.py @@ -1,8 +1,7 @@ # -*- coding: UTF-8 -*# from datetime import datetime, timedelta, time -from enum import IntEnum from typing import Any, Dict, List - +from enum import IntEnum from .utils import deprecated, pretty_time, pretty_seconds diff --git a/miio/wifispeaker.py b/miio/wifispeaker.py index 9fe746ccc..ac4ca0b46 100644 --- a/miio/wifispeaker.py +++ b/miio/wifispeaker.py @@ -1,6 +1,5 @@ -import logging import warnings - +import logging from .device import Device _LOGGER = logging.getLogger(__name__) diff --git a/miio/yeelight.py b/miio/yeelight.py index d5c5eaa45..ed3315a3c 100644 --- a/miio/yeelight.py +++ b/miio/yeelight.py @@ -1,7 +1,6 @@ -import warnings -from enum import IntEnum from typing import Tuple, Optional - +from enum import IntEnum +import warnings from .device import Device, DeviceException diff --git a/mirobo/__init__.py b/mirobo/__init__.py index ccab89525..0a8227ce4 100644 --- a/mirobo/__init__.py +++ b/mirobo/__init__.py @@ -1,4 +1,5 @@ # flake8: noqa +from miio import * import warnings warnings.simplefilter('always', DeprecationWarning) warnings.warn("Please convert to using 'miio' package, this package will "