PySwitchbot 2.3.0__tar.gz → 2.4.1__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.
Files changed (82) hide show
  1. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/PKG-INFO +1 -1
  2. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/pyproject.toml +2 -2
  3. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/__init__.py +2 -5
  4. pyswitchbot-2.4.1/switchbot/__version__.py +1 -0
  5. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parser.py +12 -0
  6. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/const/__init__.py +1 -0
  7. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/const/fan.py +6 -0
  8. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/ceiling_light.py +1 -1
  9. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/device.py +1 -0
  10. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/fan.py +5 -1
  11. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/meter_pro.py +6 -2
  12. pyswitchbot-2.3.0/switchbot/__version__.py +0 -1
  13. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/LICENSE +0 -0
  14. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/README.md +0 -0
  15. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/__init__.py +0 -0
  16. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/_sensor_th.py +0 -0
  17. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/air_purifier.py +0 -0
  18. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/art_frame.py +0 -0
  19. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/blind_tilt.py +0 -0
  20. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/bot.py +0 -0
  21. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/bulb.py +0 -0
  22. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/ceiling_light.py +0 -0
  23. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/climate_panel.py +0 -0
  24. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/contact.py +0 -0
  25. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/curtain.py +0 -0
  26. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/fan.py +0 -0
  27. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/hub2.py +0 -0
  28. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/hub3.py +0 -0
  29. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/hubmini_matter.py +0 -0
  30. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/humidifier.py +0 -0
  31. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/keypad.py +0 -0
  32. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/keypad_vision.py +0 -0
  33. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/leak.py +0 -0
  34. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/light_strip.py +0 -0
  35. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/lock.py +0 -0
  36. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/meter.py +0 -0
  37. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/motion.py +0 -0
  38. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/plug.py +0 -0
  39. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/presence_sensor.py +0 -0
  40. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/relay_switch.py +0 -0
  41. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/remote.py +0 -0
  42. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/roller_shade.py +0 -0
  43. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/smart_thermostat_radiator.py +0 -0
  44. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/vacuum.py +0 -0
  45. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/adv_parsers/weather_station.py +0 -0
  46. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/api_config.py +0 -0
  47. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/const/air_purifier.py +0 -0
  48. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/const/climate.py +0 -0
  49. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/const/evaporative_humidifier.py +0 -0
  50. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/const/hub2.py +0 -0
  51. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/const/hub3.py +0 -0
  52. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/const/light.py +0 -0
  53. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/const/lock.py +0 -0
  54. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/const/presence_sensor.py +0 -0
  55. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/__init__.py +0 -0
  56. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/air_purifier.py +0 -0
  57. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/art_frame.py +0 -0
  58. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/base_cover.py +0 -0
  59. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/base_light.py +0 -0
  60. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/blind_tilt.py +0 -0
  61. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/bot.py +0 -0
  62. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/bulb.py +0 -0
  63. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/contact.py +0 -0
  64. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/curtain.py +0 -0
  65. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/evaporative_humidifier.py +0 -0
  66. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/humidifier.py +0 -0
  67. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/keypad.py +0 -0
  68. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/keypad_vision.py +0 -0
  69. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/light_strip.py +0 -0
  70. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/lock.py +0 -0
  71. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/meter.py +0 -0
  72. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/motion.py +0 -0
  73. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/plug.py +0 -0
  74. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/relay_switch.py +0 -0
  75. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/roller_shade.py +0 -0
  76. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/smart_thermostat_radiator.py +0 -0
  77. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/devices/vacuum.py +0 -0
  78. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/discovery.py +0 -0
  79. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/enum.py +0 -0
  80. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/helpers.py +0 -0
  81. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/models.py +0 -0
  82. {pyswitchbot-2.3.0 → pyswitchbot-2.4.1}/switchbot/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySwitchbot
3
- Version: 2.3.0
3
+ Version: 2.4.1
4
4
  Summary: A library to communicate with Switchbot
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "PySwitchbot"
3
- version = "2.3.0"
3
+ version = "2.4.1"
4
4
  description = "A library to communicate with Switchbot"
5
5
  authors = ["Daniel Hjelseth Hoyer"]
6
6
  license = "MIT"
@@ -34,7 +34,7 @@ pyOpenSSL = ">=23.0.0"
34
34
  [tool.poetry.group.dev.dependencies]
35
35
  pytest = ">=7,<10"
36
36
  pytest-cov = ">=3,<8"
37
- pytest-asyncio = ">=0.19,<1.4"
37
+ pytest-asyncio = ">=0.19,<1.5"
38
38
 
39
39
  [tool.semantic_release]
40
40
  branch = "main"
@@ -61,7 +61,7 @@ from .devices.light_strip import (
61
61
  SwitchbotStripLight3,
62
62
  )
63
63
  from .devices.lock import SwitchbotLock
64
- from .devices.meter_pro import SwitchbotMeterProCO2
64
+ from .devices.meter_pro import SwitchbotMeterPro, SwitchbotMeterProCO2
65
65
  from .devices.plug import SwitchbotPlugMini
66
66
  from .devices.relay_switch import (
67
67
  SwitchbotGarageDoorOpener,
@@ -95,7 +95,6 @@ __all__ = [
95
95
  "StripLightColorMode",
96
96
  "SwitchBotAdvertisement",
97
97
  "Switchbot",
98
- "Switchbot",
99
98
  "SwitchbotAccountConnectionError",
100
99
  "SwitchbotAirPurifier",
101
100
  "SwitchbotApiError",
@@ -116,13 +115,12 @@ __all__ = [
116
115
  "SwitchbotKeypadVision",
117
116
  "SwitchbotLightStrip",
118
117
  "SwitchbotLock",
118
+ "SwitchbotMeterPro",
119
119
  "SwitchbotMeterProCO2",
120
120
  "SwitchbotModel",
121
- "SwitchbotModel",
122
121
  "SwitchbotOperationError",
123
122
  "SwitchbotPermanentOutdoorLight",
124
123
  "SwitchbotPlugMini",
125
- "SwitchbotPlugMini",
126
124
  "SwitchbotRelaySwitch",
127
125
  "SwitchbotRelaySwitch2PM",
128
126
  "SwitchbotRgbicLight",
@@ -133,7 +131,6 @@ __all__ = [
133
131
  "SwitchbotStandingFan",
134
132
  "SwitchbotStripLight3",
135
133
  "SwitchbotSupportedType",
136
- "SwitchbotSupportedType",
137
134
  "SwitchbotVacuum",
138
135
  "VerticalOscillationAngle",
139
136
  "close_stale_connections",
@@ -0,0 +1 @@
1
+ __version__ = "2.4.1"
@@ -678,6 +678,18 @@ SUPPORTED_TYPES: dict[str | bytes, SwitchbotSupportedType] = {
678
678
  "func": process_rgbic_light,
679
679
  "manufacturer_id": 2409,
680
680
  },
681
+ b"\x00\x11\xbe\xf8": {
682
+ "modelName": SwitchbotModel.RGBICWW_LIGHT_BARS,
683
+ "modelFriendlyName": "RGBICWW Light Bars",
684
+ "func": process_rgbic_light,
685
+ "manufacturer_id": 2409,
686
+ },
687
+ b"\x01\x11\xbe\xf8": {
688
+ "modelName": SwitchbotModel.RGBICWW_LIGHT_BARS,
689
+ "modelFriendlyName": "RGBICWW Light Bars",
690
+ "func": process_rgbic_light,
691
+ "manufacturer_id": 2409,
692
+ },
681
693
  b"\x00\x11\xbb\x10": {
682
694
  "modelName": SwitchbotModel.RGBICWW_CEILING_LIGHT,
683
695
  "modelFriendlyName": "RGBICWW Ceiling Light",
@@ -107,6 +107,7 @@ class SwitchbotModel(StrEnum):
107
107
  PLUG_MINI_EU = "Plug Mini (EU)"
108
108
  RGBICWW_STRIP_LIGHT = "RGBICWW Strip Light"
109
109
  RGBICWW_FLOOR_LAMP = "RGBICWW Floor Lamp"
110
+ RGBICWW_LIGHT_BARS = "RGBICWW Light Bars"
110
111
  RGBICWW_CEILING_LIGHT = "RGBICWW Ceiling Light"
111
112
  PERMANENT_OUTDOOR_LIGHT = "Permanent Outdoor Light"
112
113
  RGBIC_NEON_ROPE_LIGHT = "RGBIC Neon Rope Light"
@@ -60,3 +60,9 @@ class VerticalOscillationAngle(Enum):
60
60
  ANGLE_30 = 30
61
61
  ANGLE_60 = 60
62
62
  ANGLE_90 = 95
63
+
64
+ @classmethod
65
+ def _missing_(cls, value: int) -> VerticalOscillationAngle | None:
66
+ if value == 90:
67
+ return cls.ANGLE_90
68
+ return None
@@ -64,7 +64,7 @@ class SwitchbotCeilingLight(SwitchbotSequenceBaseLight):
64
64
 
65
65
  return {
66
66
  "isOn": bool(_data[1] & 0b10000000),
67
- "color_mode": _data[1] & 0b01000000,
67
+ "color_mode": (_data[1] & 0b01000000) >> 6,
68
68
  "brightness": _data[2] & 0b01111111,
69
69
  "cw": self._state["cw"],
70
70
  "firmware": _version_info[2] / 10.0,
@@ -102,6 +102,7 @@ API_MODEL_TO_ENUM: dict[str, SwitchbotModel] = {
102
102
  "W1102001": SwitchbotModel.STRIP_LIGHT_3,
103
103
  "W1102003": SwitchbotModel.RGBICWW_STRIP_LIGHT,
104
104
  "W1102004": SwitchbotModel.RGBICWW_FLOOR_LAMP,
105
+ "W1163000": SwitchbotModel.RGBICWW_LIGHT_BARS,
105
106
  "W1162000": SwitchbotModel.RGBICWW_CEILING_LIGHT,
106
107
  "W1104000": SwitchbotModel.PLUG_MINI_EU,
107
108
  "W1128000": SwitchbotModel.SMART_THERMOSTAT_RADIATOR,
@@ -241,7 +241,11 @@ class SwitchbotStandingFan(SwitchbotFan):
241
241
  @update_after_operation
242
242
  async def set_night_light(self, state: NightLightState | int) -> bool:
243
243
  """Set night-light state (LEVEL_1, LEVEL_2, OFF)."""
244
- value = NightLightState(state).value
244
+ state = NightLightState(state)
245
+ # The Standing Fan firmware ignores the OFF byte defined by
246
+ # NightLightState (0x03) and only turns the night light off when it
247
+ # receives 0x00. Map OFF -> 0x00 here; LEVEL_1/LEVEL_2 are unchanged.
248
+ value = 0 if state is NightLightState.OFF else state.value
245
249
  cmd = f"{COMMAND_SET_NIGHT_LIGHT}{value:02X}FFFF"
246
250
  result = await self._send_command(cmd)
247
251
  return self._check_command_result(result, 0, {1})
@@ -12,8 +12,8 @@ COMMAND_SET_DEVICE_DATETIME = "57000503"
12
12
  COMMAND_SET_DISPLAY_FORMAT = "570f680505"
13
13
 
14
14
 
15
- class SwitchbotMeterProCO2(SwitchbotDevice):
16
- """API to control Switchbot Meter Pro CO2."""
15
+ class SwitchbotMeterPro(SwitchbotDevice):
16
+ """API to control Switchbot Meter Pro (and Meter Pro CO2, which shares the same datetime protocol)."""
17
17
 
18
18
  async def get_time_offset(self) -> int:
19
19
  """
@@ -170,3 +170,7 @@ class SwitchbotMeterProCO2(SwitchbotDevice):
170
170
  f"{self.name}: Unexpected response len for {op_name}, wanted at least {min_length} (result={result.hex() if result else 'None'} rssi={self.rssi})"
171
171
  )
172
172
  return result
173
+
174
+
175
+ class SwitchbotMeterProCO2(SwitchbotMeterPro):
176
+ """API to control Switchbot Meter Pro CO2."""
@@ -1 +0,0 @@
1
- __version__ = "2.3.0"
File without changes
File without changes