Skip to content

Commit 7fc4540

Browse files
authored
Add known models to supported models (#1202)
* airhumidifier: add supported models * gateway: add supported models * aurqualitymonitor: add supported models * Add currently known models to supported models
1 parent 5e03352 commit 7fc4540

37 files changed

Lines changed: 123 additions & 2 deletions

miio/airconditioningcompanion.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ def mode(self) -> Optional[OperationMode]:
227227
class AirConditioningCompanion(Device):
228228
"""Main class representing Xiaomi Air Conditioning Companion V1 and V2."""
229229

230+
_supported_models = MODELS_SUPPORTED
231+
230232
def __init__(
231233
self,
232234
ip: str = None,

miio/airconditioningcompanionMCN.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ def swing_mode(self) -> Optional[SwingMode]:
102102
class AirConditioningCompanionMcn02(Device):
103103
"""Main class representing Xiaomi Air Conditioning Companion V1 and V2."""
104104

105+
_supported_models = [MODEL_ACPARTNER_MCN02]
106+
105107
def __init__(
106108
self,
107109
ip: str = None,

miio/airdehumidifier.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ def alarm(self) -> str:
158158
class AirDehumidifier(Device):
159159
"""Implementation of Xiaomi Mi Air Dehumidifier."""
160160

161+
_supported_models = list(AVAILABLE_PROPERTIES.keys())
162+
161163
@command(
162164
default_output=format_output(
163165
"",

miio/airfresh.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ def extra_features(self) -> Optional[int]:
219219
class AirFresh(Device):
220220
"""Main class representing the air fresh."""
221221

222+
_supported_models = list(AVAILABLE_PROPERTIES.keys())
223+
222224
@command(
223225
default_output=format_output(
224226
"",

miio/airfresh_t2017.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ def display_orientation(self) -> Optional[DisplayOrientation]:
224224
class AirFreshA1(Device):
225225
"""Main class representing the air fresh a1."""
226226

227+
_supported_models = list(AVAILABLE_PROPERTIES.keys())
228+
227229
@command(
228230
default_output=format_output(
229231
"",

miio/airhumidifier.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
MODEL_HUMIDIFIER_CB1 = "zhimi.humidifier.cb1"
1818
MODEL_HUMIDIFIER_CB2 = "zhimi.humidifier.cb2"
1919

20+
SUPPORTED_MODELS = [
21+
MODEL_HUMIDIFIER_V1,
22+
MODEL_HUMIDIFIER_CA1,
23+
MODEL_HUMIDIFIER_CB1,
24+
MODEL_HUMIDIFIER_CB2,
25+
]
26+
2027
AVAILABLE_PROPERTIES_COMMON = [
2128
"power",
2229
"mode",
@@ -251,6 +258,8 @@ def button_pressed(self) -> Optional[str]:
251258
class AirHumidifier(Device):
252259
"""Implementation of Xiaomi Mi Air Humidifier."""
253260

261+
_supported_models = SUPPORTED_MODELS
262+
254263
@command(
255264
default_output=format_output(
256265
"",

miio/airhumidifier_jsq.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ def use_time(self) -> Optional[int]:
141141
class AirHumidifierJsq(Device):
142142
"""Implementation of Xiaomi Zero Fog Humidifier: shuii.humidifier.jsq001."""
143143

144+
_supported_models = [MODEL_HUMIDIFIER_JSQ001]
145+
144146
@command(
145147
default_output=format_output(
146148
"",

miio/airhumidifier_mjjsq.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ def use_time(self) -> Optional[int]:
132132
class AirHumidifierMjjsq(Device):
133133
"""Support for deerma.humidifier.(mj)jsq."""
134134

135+
_supported_models = list(AVAILABLE_PROPERTIES.keys())
136+
135137
@command(
136138
default_output=format_output(
137139
"",

miio/airpurifier.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
_LOGGER = logging.getLogger(__name__)
1414

1515

16+
SUPPORTED_MODELS = [
17+
"zhimi.airpurifier.v3",
18+
"zhimi.airpurifier.v6",
19+
"zhimi.airpurifier.v7",
20+
"zhimi.airpurifier.m1",
21+
"zhimi.airpurifier.m2",
22+
]
23+
24+
1625
class AirPurifierException(DeviceException):
1726
pass
1827

@@ -300,6 +309,8 @@ def button_pressed(self) -> Optional[str]:
300309
class AirPurifier(Device):
301310
"""Main class representing the air purifier."""
302311

312+
_supported_models = SUPPORTED_MODELS
313+
303314
@command(
304315
default_output=format_output(
305316
"",

miio/airpurifier_airdog.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ def hcho(self) -> Optional[int]:
101101

102102

103103
class AirDogX3(Device):
104+
"""Support for Airdog air purifiers (airdog.airpurifier.x*)."""
105+
106+
_supported_models = list(AVAILABLE_PROPERTIES.keys())
107+
104108
@command(
105109
default_output=format_output(
106110
"",

0 commit comments

Comments
 (0)