switchbot-api 2.11.0__tar.gz → 2.12.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: switchbot_api
3
- Version: 2.11.0
3
+ Version: 2.12.0
4
4
  Summary: An asynchronous library to use Switchbot API
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Programming Language :: Python :: 3.14
17
17
  Requires-Dist: aiohttp (>=3.0.0)
18
+ Requires-Dist: pycryptodome (>=3.23.0,<4.0.0)
18
19
  Project-URL: Repository, https://github.com/SeraphicCorp/py-switchbot-api
19
20
  Description-Content-Type: text/markdown
20
21
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "switchbot_api"
3
- version = "2.11.0"
3
+ version = "2.12.0"
4
4
  description = "An asynchronous library to use Switchbot API"
5
5
  authors = ["Ravaka Razafimanantsoa <contact@ravaka.dev>"]
6
6
  license = "MIT"
@@ -11,6 +11,7 @@ repository = "https://github.com/SeraphicCorp/py-switchbot-api"
11
11
  [tool.poetry.dependencies]
12
12
  python = "^3.10"
13
13
  aiohttp = ">=3.0.0"
14
+ pycryptodome = "^3.23.0"
14
15
 
15
16
 
16
17
  [tool.poetry.group.dev.dependencies]
@@ -28,7 +29,6 @@ codespell = "^2.3.0"
28
29
  pre-commit = "^4.0.1"
29
30
  pre-commit-hooks = "^5.0.0"
30
31
  yamllint = "^1.35.1"
31
- pycryptodome = "^3.23.0"
32
32
 
33
33
  [tool.mypy]
34
34
  # Specify the target platform details in config, so your developers are
@@ -39,6 +39,7 @@ from switchbot_api.commands import (
39
39
  LockV2Commands,
40
40
  LockV3Commands,
41
41
  OthersCommands,
42
+ RGBICWWCeilingLightCommands,
42
43
  RGBWLightCommands,
43
44
  RGBWWLightCommands,
44
45
  RollerShadeCommands,
@@ -97,6 +98,7 @@ __all__ = [
97
98
  "LockV3Commands",
98
99
  "OthersCommands",
99
100
  "PowerState",
101
+ "RGBICWWCeilingLightCommands",
100
102
  "RGBWLightCommands",
101
103
  "RGBWWLightCommands",
102
104
  "Remote",
@@ -262,7 +264,7 @@ class SwitchBotAPI:
262
264
  """No status for IR devices."""
263
265
  response = await self._request(METH_GET, f"devices/{device_id}/status")
264
266
 
265
- device_type = response["deviceType"]
267
+ device_type = response.get("deviceType")
266
268
  if device_type and device_type in KeyPadCommands.get_supported_devices():
267
269
  return await self.get_device(device_id)
268
270
  return response
@@ -60,7 +60,7 @@ class OthersCommands(Commands):
60
60
 
61
61
 
62
62
  class CurtainCommands(Commands):
63
- """Curtain & Curtain3 commands."""
63
+ """Curtain & Curtain3 & Curtain4 commands."""
64
64
 
65
65
  SET_POSITION = "setPosition" # parameter(str): index0,mode0,position0 e.g. 0,ff,80
66
66
  PAUSE = "pause"
@@ -68,7 +68,7 @@ class CurtainCommands(Commands):
68
68
  @classmethod
69
69
  def get_supported_devices(cls) -> list[str]:
70
70
  """Get supported devices."""
71
- return ["Curtain", "Curtain 3"]
71
+ return ["Curtain", "Curtain 3", "Curtain 4"]
72
72
 
73
73
 
74
74
  class LockCommands(Commands):
@@ -240,6 +240,7 @@ class RGBWWLightCommands(Commands):
240
240
  "Color Bulb",
241
241
  "RGBICWW Floor Lamp",
242
242
  "RGBICWW Strip Light",
243
+ "Permanent Outdoor Lights",
243
244
  ]
244
245
 
245
246
 
@@ -257,6 +258,33 @@ class CeilingLightCommands(Commands):
257
258
  return ["Ceiling Light", "Ceiling Light Pro"]
258
259
 
259
260
 
261
+ class RGBICWWCeilingLightCommands(Commands):
262
+ """RGBICWW Ceiling Light commands.
263
+
264
+ The RGBICWW Ceiling Light has two independent sub-lights:
265
+ a main light (color temperature + brightness) and a
266
+ color light (RGB + brightness).
267
+ """
268
+
269
+ TURN_ON_MAIN_LIGHT = "turnOnMainLight"
270
+ TURN_OFF_MAIN_LIGHT = "turnOffMainLight"
271
+ TURN_ON_COLOR_LIGHT = "turnOnColorLight"
272
+ TURN_OFF_COLOR_LIGHT = "turnOffColorLight"
273
+ # 1-100
274
+ SET_MAIN_LIGHT_BRIGHTNESS = "setMainLightBrightness"
275
+ # 2700-6500
276
+ SET_MAIN_LIGHT_COLOR_TEMP = "setMainLightColorTemp"
277
+ # 1-100
278
+ SET_COLOR_LIGHT_BRIGHTNESS = "setColorLightBrightness"
279
+ # R:G:B
280
+ SET_COLOR_LIGHT_RGB = "setColorLightRGB"
281
+
282
+ @classmethod
283
+ def get_supported_devices(cls) -> list[str]:
284
+ """Get supported devices."""
285
+ return ["RGBICWW Ceiling Light"]
286
+
287
+
260
288
  class ArtFrameCommands(Commands):
261
289
  """AI Art Frame commands."""
262
290
 
@@ -374,7 +402,11 @@ class BatteryCirculatorFanCommands(Commands):
374
402
  @classmethod
375
403
  def get_supported_devices(cls) -> list[str]:
376
404
  """Get supported devices."""
377
- return ["Circulator Fan", "Battery Circulator Fan"]
405
+ return [
406
+ "Circulator Fan",
407
+ "Battery Circulator Fan",
408
+ "Battery Circulator Fan 2 Pro",
409
+ ]
378
410
 
379
411
 
380
412
  class TVCommands(Commands):
File without changes
File without changes