PySwitchbot 0.37.4__tar.gz → 0.37.6__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.37.4 → PySwitchbot-0.37.6}/PKG-INFO +1 -1
  2. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/PySwitchbot.egg-info/PKG-INFO +1 -1
  3. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/setup.py +1 -1
  4. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/blind_tilt.py +1 -0
  5. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/blind_tilt.py +2 -2
  6. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/device.py +18 -1
  7. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/LICENSE +0 -0
  8. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/MANIFEST.in +0 -0
  9. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/PySwitchbot.egg-info/SOURCES.txt +0 -0
  10. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/PySwitchbot.egg-info/dependency_links.txt +0 -0
  11. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/PySwitchbot.egg-info/requires.txt +0 -0
  12. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/PySwitchbot.egg-info/top_level.txt +0 -0
  13. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/README.md +0 -0
  14. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/setup.cfg +0 -0
  15. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/__init__.py +0 -0
  16. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parser.py +0 -0
  17. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/__init__.py +0 -0
  18. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/bot.py +0 -0
  19. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/bulb.py +0 -0
  20. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/ceiling_light.py +0 -0
  21. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/contact.py +0 -0
  22. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/curtain.py +0 -0
  23. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/humidifier.py +0 -0
  24. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/light_strip.py +0 -0
  25. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/lock.py +0 -0
  26. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/meter.py +0 -0
  27. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/motion.py +0 -0
  28. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/plug.py +0 -0
  29. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/api_config.py +0 -0
  30. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/const.py +0 -0
  31. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/__init__.py +0 -0
  32. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/base_light.py +0 -0
  33. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/bot.py +0 -0
  34. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/bulb.py +0 -0
  35. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/ceiling_light.py +0 -0
  36. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/contact.py +0 -0
  37. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/curtain.py +0 -0
  38. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/humidifier.py +0 -0
  39. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/light_strip.py +0 -0
  40. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/lock.py +0 -0
  41. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/meter.py +0 -0
  42. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/motion.py +0 -0
  43. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/plug.py +0 -0
  44. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/discovery.py +0 -0
  45. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/enum.py +0 -0
  46. {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySwitchbot
3
- Version: 0.37.4
3
+ Version: 0.37.6
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.37.4
3
+ Version: 0.37.6
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.37.4",
15
+ version="0.37.6",
16
16
  description="A library to communicate with Switchbot",
17
17
  author="Daniel Hjelseth Hoyer",
18
18
  url="https://github.com/Danielhiversen/pySwitchbot/",
@@ -23,4 +23,5 @@ def process_woblindtilt(
23
23
  "inMotion": _in_motion,
24
24
  "tilt": (100 - _tilt) if reverse else _tilt,
25
25
  "lightLevel": _light_level,
26
+ "sequence_number": device_data[0]
26
27
  }
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
  import logging
5
5
  from typing import Any
6
6
 
7
- from switchbot.devices.device import REQ_HEADER, update_after_operation
7
+ from switchbot.devices.device import REQ_HEADER, update_after_operation, SwitchbotSequenceDevice
8
8
 
9
9
  from .curtain import CURTAIN_EXT_SUM_KEY, SwitchbotCurtain
10
10
 
@@ -26,7 +26,7 @@ CLOSE_UP_KEYS = [
26
26
  ]
27
27
 
28
28
 
29
- class SwitchbotBlindTilt(SwitchbotCurtain):
29
+ class SwitchbotBlindTilt(SwitchbotCurtain, SwitchbotSequenceDevice):
30
30
  """Representation of a Switchbot Blind Tilt."""
31
31
 
32
32
  # The position of the blind is saved returned with 0 = closed down, 50 = open and 100 = closed up.
@@ -253,11 +253,21 @@ class SwitchbotBaseDevice:
253
253
  self.rssi,
254
254
  )
255
255
  if self._client and self._client.is_connected:
256
+ _LOGGER.debug(
257
+ "%s: Already connected before obtaining lock, resetting timer; RSSI: %s",
258
+ self.name,
259
+ self.rssi,
260
+ )
256
261
  self._reset_disconnect_timer()
257
262
  return
258
263
  async with self._connect_lock:
259
264
  # Check again while holding the lock
260
265
  if self._client and self._client.is_connected:
266
+ _LOGGER.debug(
267
+ "%s: Already connected after obtaining lock, resetting timer; RSSI: %s",
268
+ self.name,
269
+ self.rssi,
270
+ )
261
271
  self._reset_disconnect_timer()
262
272
  return
263
273
  _LOGGER.debug("%s: Connecting; RSSI: %s", self.name, self.rssi)
@@ -287,6 +297,11 @@ class SwitchbotBaseDevice:
287
297
  await self._execute_disconnect_with_lock()
288
298
  raise
289
299
 
300
+ _LOGGER.debug(
301
+ "%s: Starting notify and disconnect timer; RSSI: %s",
302
+ self.name,
303
+ self.rssi,
304
+ )
290
305
  self._reset_disconnect_timer()
291
306
  await self._start_notify()
292
307
 
@@ -319,6 +334,7 @@ class SwitchbotBaseDevice:
319
334
  self.name,
320
335
  self.rssi,
321
336
  )
337
+ self._cancel_disconnect_timer()
322
338
 
323
339
  def _disconnect_from_timer(self):
324
340
  """Disconnect from device."""
@@ -390,7 +406,8 @@ class SwitchbotBaseDevice:
390
406
  ex,
391
407
  self.rssi,
392
408
  )
393
- _LOGGER.debug("%s: Disconnect completed", self.name)
409
+ else:
410
+ _LOGGER.debug("%s: Disconnect completed successfully", self.name)
394
411
 
395
412
  async def _send_command_locked(self, key: str, command: bytes) -> bytes:
396
413
  """Send command to device and read response."""
File without changes
File without changes
File without changes
File without changes