switchbot-api 2.8.0__tar.gz → 2.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {switchbot_api-2.8.0 → switchbot_api-2.9.0}/PKG-INFO +1 -1
- {switchbot_api-2.8.0 → switchbot_api-2.9.0}/pyproject.toml +1 -1
- {switchbot_api-2.8.0 → switchbot_api-2.9.0}/switchbot_api/commands.py +50 -16
- {switchbot_api-2.8.0 → switchbot_api-2.9.0}/switchbot_api/models.py +23 -0
- {switchbot_api-2.8.0 → switchbot_api-2.9.0}/LICENSE +0 -0
- {switchbot_api-2.8.0 → switchbot_api-2.9.0}/README.md +0 -0
- {switchbot_api-2.8.0 → switchbot_api-2.9.0}/switchbot_api/__init__.py +0 -0
- {switchbot_api-2.8.0 → switchbot_api-2.9.0}/switchbot_api/exceptions.py +0 -0
|
@@ -190,13 +190,15 @@ class RGBWLightCommands(Commands):
|
|
|
190
190
|
|
|
191
191
|
# Supported Device list:
|
|
192
192
|
# Strip Light
|
|
193
|
+
# RGBIC Neon Rope Light
|
|
194
|
+
# RGBIC Neon Wire Rope Light
|
|
193
195
|
SET_BRIGHTNESS = "setBrightness"
|
|
194
196
|
SET_COLOR = "setColor"
|
|
195
197
|
|
|
196
198
|
@classmethod
|
|
197
199
|
def get_supported_devices(cls) -> list[str]:
|
|
198
200
|
"""Get supported devices."""
|
|
199
|
-
return ["Strip Light"]
|
|
201
|
+
return ["Strip Light", "RGBIC Neon Rope Light", "RGBIC Neon Wire Rope Light"]
|
|
200
202
|
|
|
201
203
|
|
|
202
204
|
class RGBWWLightCommands(Commands):
|
|
@@ -206,6 +208,8 @@ class RGBWWLightCommands(Commands):
|
|
|
206
208
|
# Floor Lamp
|
|
207
209
|
# Strip Light 3
|
|
208
210
|
# Color Bulb
|
|
211
|
+
# RGBICWW Floor Lamp
|
|
212
|
+
# RGBICWW Strip Light
|
|
209
213
|
SET_BRIGHTNESS = "setBrightness"
|
|
210
214
|
SET_COLOR = "setColor"
|
|
211
215
|
SET_COLOR_TEMPERATURE = "setColorTemperature"
|
|
@@ -213,7 +217,39 @@ class RGBWWLightCommands(Commands):
|
|
|
213
217
|
@classmethod
|
|
214
218
|
def get_supported_devices(cls) -> list[str]:
|
|
215
219
|
"""Get supported devices."""
|
|
216
|
-
return [
|
|
220
|
+
return [
|
|
221
|
+
"Strip Light 3",
|
|
222
|
+
"Floor Lamp",
|
|
223
|
+
"Color Bulb",
|
|
224
|
+
"RGBICWW Floor Lamp",
|
|
225
|
+
"RGBICWW Strip Light",
|
|
226
|
+
]
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
class CeilingLightCommands(Commands):
|
|
230
|
+
"""Ceiling light commands."""
|
|
231
|
+
|
|
232
|
+
# 1-100
|
|
233
|
+
SET_BRIGHTNESS = "setBrightness"
|
|
234
|
+
# 2700-6500
|
|
235
|
+
SET_COLOR_TEMPERATURE = "setColorTemperature"
|
|
236
|
+
|
|
237
|
+
@classmethod
|
|
238
|
+
def get_supported_devices(cls) -> list[str]:
|
|
239
|
+
"""Get supported devices."""
|
|
240
|
+
return ["Ceiling Light", "Ceiling Light Pro"]
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
class ArtFrameCommands(Commands):
|
|
244
|
+
"""AI Art Frame commands."""
|
|
245
|
+
|
|
246
|
+
PREVIOUS = "previous"
|
|
247
|
+
NEXT = "next"
|
|
248
|
+
|
|
249
|
+
@classmethod
|
|
250
|
+
def get_supported_devices(cls) -> list[str]:
|
|
251
|
+
"""Get supported devices."""
|
|
252
|
+
return ["AI Art Frame"]
|
|
217
253
|
|
|
218
254
|
|
|
219
255
|
class DoorBellCommands(Commands):
|
|
@@ -285,20 +321,6 @@ class VacuumCleanerV3Commands(Commands):
|
|
|
285
321
|
return ["Robot Vacuum Cleaner S10", "S20"]
|
|
286
322
|
|
|
287
323
|
|
|
288
|
-
class CeilingLightCommands(Commands):
|
|
289
|
-
"""Ceiling light commands."""
|
|
290
|
-
|
|
291
|
-
# 1-100
|
|
292
|
-
SET_BRIGHTNESS = "setBrightness"
|
|
293
|
-
# 2700-6500
|
|
294
|
-
SET_COLOR_TEMPERATURE = "setColorTemperature"
|
|
295
|
-
|
|
296
|
-
@classmethod
|
|
297
|
-
def get_supported_devices(cls) -> list[str]:
|
|
298
|
-
"""Get supported devices."""
|
|
299
|
-
return ["Ceiling Light", "Ceiling Light Pro"]
|
|
300
|
-
|
|
301
|
-
|
|
302
324
|
class BlindTiltCommands(Commands):
|
|
303
325
|
"""Blind Tilt commands."""
|
|
304
326
|
|
|
@@ -396,4 +418,16 @@ class SmartRadiatorThermostatCommands(Commands):
|
|
|
396
418
|
return ["Smart Radiator Thermostat"]
|
|
397
419
|
|
|
398
420
|
|
|
421
|
+
class KeyPadCommands(Commands):
|
|
422
|
+
"""Keypad commands."""
|
|
423
|
+
|
|
424
|
+
DELETE_KEY = "deleteKey"
|
|
425
|
+
CREATE_KEY = "createKey"
|
|
426
|
+
|
|
427
|
+
@classmethod
|
|
428
|
+
def get_supported_devices(cls) -> list[str]:
|
|
429
|
+
"""Get supported devices."""
|
|
430
|
+
return ["Keypad", "Keypad Touch", "Keypad Vision", "Keypad Vision pro"]
|
|
431
|
+
|
|
432
|
+
|
|
399
433
|
T = TypeVar("T", bound=CommonCommands)
|
|
@@ -68,3 +68,26 @@ class SmartRadiatorThermostatMode(Enum):
|
|
|
68
68
|
cls.COMFORT,
|
|
69
69
|
cls.FAST_HEATING,
|
|
70
70
|
]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class BatteryLevel(Enum):
|
|
74
|
+
"""Battery Level modes."""
|
|
75
|
+
|
|
76
|
+
High = "high"
|
|
77
|
+
Medium = "medium"
|
|
78
|
+
Low = "low"
|
|
79
|
+
Critical = "critical"
|
|
80
|
+
Unknown = "unknown"
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def get_battery_level(cls, value: int) -> BatteryLevel:
|
|
84
|
+
"""Return a battery level."""
|
|
85
|
+
if 100 >= value >= 60:
|
|
86
|
+
return cls.High
|
|
87
|
+
if 60 > value >= 20:
|
|
88
|
+
return cls.Medium
|
|
89
|
+
if 20 > value >= 10:
|
|
90
|
+
return cls.Low
|
|
91
|
+
if 10 > value >= 0:
|
|
92
|
+
return cls.Critical
|
|
93
|
+
return cls.Unknown
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|