PySwitchbot 0.38.0__tar.gz → 0.39.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.
Files changed (46) hide show
  1. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/PKG-INFO +1 -1
  2. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/PySwitchbot.egg-info/PKG-INFO +1 -1
  3. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/setup.py +1 -1
  4. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/lock.py +1 -0
  5. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/lock.py +12 -1
  6. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/LICENSE +0 -0
  7. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/MANIFEST.in +0 -0
  8. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/PySwitchbot.egg-info/SOURCES.txt +0 -0
  9. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/PySwitchbot.egg-info/dependency_links.txt +0 -0
  10. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/PySwitchbot.egg-info/requires.txt +0 -0
  11. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/PySwitchbot.egg-info/top_level.txt +0 -0
  12. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/README.md +0 -0
  13. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/setup.cfg +0 -0
  14. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/__init__.py +0 -0
  15. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parser.py +0 -0
  16. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/__init__.py +0 -0
  17. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/blind_tilt.py +0 -0
  18. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/bot.py +0 -0
  19. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/bulb.py +0 -0
  20. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/ceiling_light.py +0 -0
  21. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/contact.py +0 -0
  22. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/curtain.py +0 -0
  23. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/humidifier.py +0 -0
  24. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/light_strip.py +0 -0
  25. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/meter.py +0 -0
  26. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/motion.py +0 -0
  27. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/adv_parsers/plug.py +0 -0
  28. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/api_config.py +0 -0
  29. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/const.py +0 -0
  30. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/__init__.py +0 -0
  31. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/base_light.py +0 -0
  32. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/blind_tilt.py +0 -0
  33. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/bot.py +0 -0
  34. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/bulb.py +0 -0
  35. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/ceiling_light.py +0 -0
  36. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/contact.py +0 -0
  37. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/curtain.py +0 -0
  38. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/device.py +0 -0
  39. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/humidifier.py +0 -0
  40. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/light_strip.py +0 -0
  41. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/meter.py +0 -0
  42. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/motion.py +0 -0
  43. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/devices/plug.py +0 -0
  44. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/discovery.py +0 -0
  45. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/enum.py +0 -0
  46. {PySwitchbot-0.38.0 → PySwitchbot-0.39.0}/switchbot/models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySwitchbot
3
- Version: 0.38.0
3
+ Version: 0.39.0
4
4
  Summary: A library to communicate with Switchbot
5
5
  Home-page: https://github.com/Danielhiversen/pySwitchbot/
6
6
  Author: Daniel Hjelseth Hoyer
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySwitchbot
3
- Version: 0.38.0
3
+ Version: 0.39.0
4
4
  Summary: A library to communicate with Switchbot
5
5
  Home-page: https://github.com/Danielhiversen/pySwitchbot/
6
6
  Author: Daniel Hjelseth Hoyer
@@ -12,7 +12,7 @@ setup(
12
12
  "boto3>=1.20.24",
13
13
  "requests>=2.28.1",
14
14
  ],
15
- version="0.38.0",
15
+ version="0.39.0",
16
16
  description="A library to communicate with Switchbot",
17
17
  author="Daniel Hjelseth Hoyer",
18
18
  url="https://github.com/Danielhiversen/pySwitchbot/",
@@ -27,4 +27,5 @@ def process_wolock(data: bytes | None, mfr_data: bytes | None) -> dict[str, bool
27
27
  "unclosed_alarm": bool(mfr_data[8] & 0b00100000),
28
28
  "unlocked_alarm": bool(mfr_data[8] & 0b00010000),
29
29
  "auto_lock_paused": bool(mfr_data[8] & 0b00000010),
30
+ "night_latch": bool(mfr_data[9] & 0b00000001),
30
31
  }
@@ -26,6 +26,7 @@ COMMAND_HEADER = "57"
26
26
  COMMAND_GET_CK_IV = f"{COMMAND_HEADER}0f2103"
27
27
  COMMAND_LOCK_INFO = f"{COMMAND_HEADER}0f4f8101"
28
28
  COMMAND_UNLOCK = f"{COMMAND_HEADER}0f4e01011080"
29
+ COMMAND_UNLOCK_WITHOUT_UNLATCH = f"{COMMAND_HEADER}0f4e010110a0"
29
30
  COMMAND_LOCK = f"{COMMAND_HEADER}0f4e01011000"
30
31
  COMMAND_ENABLE_NOTIFICATIONS = f"{COMMAND_HEADER}0e01001e00008101"
31
32
  COMMAND_DISABLE_NOTIFICATIONS = f"{COMMAND_HEADER}0e00"
@@ -164,11 +165,17 @@ class SwitchbotLock(SwitchbotDevice):
164
165
  )
165
166
 
166
167
  async def unlock(self) -> bool:
167
- """Send unlock command."""
168
+ """Send unlock command. If unlatch feature is enabled in EU firmware, also unlatches door"""
168
169
  return await self._lock_unlock(
169
170
  COMMAND_UNLOCK, {LockStatus.UNLOCKED, LockStatus.UNLOCKING}
170
171
  )
171
172
 
173
+ async def unlock_without_unlatch(self) -> bool:
174
+ """Send unlock command. This command will not unlatch the door."""
175
+ return await self._lock_unlock(
176
+ COMMAND_UNLOCK_WITHOUT_UNLATCH, {LockStatus.UNLOCKED, LockStatus.UNLOCKING, LockStatus.NOT_FULLY_LOCKED}
177
+ )
178
+
172
179
  def _parse_basic_data(self, basic_data: bytes) -> dict[str, Any]:
173
180
  """Parse basic data from lock."""
174
181
  return {
@@ -239,6 +246,10 @@ class SwitchbotLock(SwitchbotDevice):
239
246
  """Return True if auto lock is paused."""
240
247
  return self._get_adv_value("auto_lock_paused")
241
248
 
249
+ def is_night_latch_enabled(self) -> bool:
250
+ """Return True if Night Latch is enabled on EU firmware."""
251
+ return self._get_adv_value("night_latch")
252
+
242
253
  async def _get_lock_info(self) -> bytes | None:
243
254
  """Return lock info of device."""
244
255
  _data = await self._send_command(key=COMMAND_LOCK_INFO, retry=self._retry_count)
File without changes
File without changes
File without changes
File without changes