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

Use integration type specific imports #1366

Merged
merged 1 commit into from
Mar 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions miio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,23 @@
from miio.heater import Heater
from miio.heater_miot import HeaterMiot
from miio.huizuo import Huizuo, HuizuoLampFan, HuizuoLampHeater, HuizuoLampScene
from miio.integrations.airpurifier.airdog import AirDogX3
from miio.integrations.airpurifier.dmaker import AirFreshA1, AirFreshT2017
from miio.integrations.airpurifier.zhimi import AirFresh, AirPurifier, AirPurifierMiot
from miio.integrations.fan.dmaker import Fan1C, FanMiot, FanP5
from miio.integrations.fan.leshow import FanLeshow
from miio.integrations.fan.zhimi import Fan, FanZA5
from miio.integrations.airpurifier import (
AirDogX3,
AirFresh,
AirFreshA1,
AirFreshT2017,
AirPurifier,
AirPurifierMiot,
)
from miio.integrations.fan import Fan, Fan1C, FanLeshow, FanMiot, FanP5, FanZA5
from miio.integrations.humidifier import (
AirHumidifier,
AirHumidifierJsq,
AirHumidifierJsqs,
AirHumidifierMiot,
AirHumidifierMjjsq,
)
from miio.integrations.light.philips import (
from miio.integrations.light import (
Ceil,
PhilipsBulb,
PhilipsEyecare,
Expand All @@ -56,9 +59,14 @@
PhilipsWhiteBulb,
)
from miio.integrations.petwaterdispenser import PetWaterDispenser
from miio.integrations.vacuum.dreame.dreamevacuum_miot import DreameVacuum
from miio.integrations.vacuum.mijia import G1Vacuum
from miio.integrations.vacuum.roborock import RoborockVacuum, VacuumException
from miio.integrations.vacuum import (
DreameVacuum,
G1Vacuum,
RoborockVacuum,
RoidmiVacuumMiot,
VacuumException,
ViomiVacuum,
)
from miio.integrations.vacuum.roborock.vacuumcontainers import (
CleaningDetails,
CleaningSummary,
Expand All @@ -67,8 +75,6 @@
Timer,
VacuumStatus,
)
from miio.integrations.vacuum.roidmi.roidmivacuum_miot import RoidmiVacuumMiot
from miio.integrations.vacuum.viomi.viomivacuum import ViomiVacuum
from miio.integrations.yeelight import Yeelight
from miio.powerstrip import PowerStrip
from miio.protocol import Message, Utils
Expand Down
20 changes: 9 additions & 11 deletions miio/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
AirHumidifierJsqs,
AirHumidifierMjjsq,
)
from miio.integrations.vacuum import DreameVacuum, RoborockVacuum, ViomiVacuum
from miio.integrations.yeelight import Yeelight

from . import (
Expand All @@ -35,19 +36,10 @@
ChuangmiPlug,
Cooker,
Device,
DreameVacuum,
FanLeshow,
Gateway,
Heater,
PhilipsBulb,
PhilipsEyecare,
PhilipsMoonlight,
PhilipsRwread,
PhilipsWhiteBulb,
PowerStrip,
RoborockVacuum,
Toiletlid,
ViomiVacuum,
WaterPurifier,
WaterPurifierYunmi,
WifiRepeater,
Expand Down Expand Up @@ -75,8 +67,14 @@
MODEL_CHUANGMI_PLUG_V3,
)
from .heater import MODEL_HEATER_MA1, MODEL_HEATER_ZA1
from .integrations.fan.dmaker import FanMiot
from .integrations.fan.zhimi import Fan, FanZA5
from .integrations.fan import Fan, FanLeshow, FanMiot, FanZA5
from .integrations.light import (
PhilipsBulb,
PhilipsEyecare,
PhilipsMoonlight,
PhilipsRwread,
PhilipsWhiteBulb,
)
from .powerstrip import MODEL_POWER_STRIP_V1, MODEL_POWER_STRIP_V2
from .toiletlid import MODEL_TOILETLID_V1

Expand Down
4 changes: 4 additions & 0 deletions miio/integrations/fan/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# flake8: noqa
from .dmaker import *
from .leshow import *
from .zhimi import *
2 changes: 2 additions & 0 deletions miio/integrations/light/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# flake8: noqa
from .philips import *
6 changes: 6 additions & 0 deletions miio/integrations/vacuum/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# flake8: noqa
from .dreame import *
from .mijia import *
from .roborock import *
from .roidmi import *
from .viomi import *
2 changes: 2 additions & 0 deletions miio/integrations/vacuum/dreame/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# flake8: noqa
from .dreamevacuum_miot import DreameVacuum
2 changes: 2 additions & 0 deletions miio/integrations/vacuum/roidmi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# flake8: noqa
from .roidmivacuum_miot import RoidmiVacuumMiot
2 changes: 2 additions & 0 deletions miio/integrations/vacuum/viomi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# flake8: noqa
from .viomivacuum import ViomiVacuum