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.
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/PKG-INFO +1 -1
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/PySwitchbot.egg-info/PKG-INFO +1 -1
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/setup.py +1 -1
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/blind_tilt.py +1 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/blind_tilt.py +2 -2
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/device.py +18 -1
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/LICENSE +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/MANIFEST.in +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/PySwitchbot.egg-info/SOURCES.txt +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/PySwitchbot.egg-info/dependency_links.txt +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/PySwitchbot.egg-info/requires.txt +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/PySwitchbot.egg-info/top_level.txt +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/README.md +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/setup.cfg +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/__init__.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parser.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/__init__.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/bot.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/bulb.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/ceiling_light.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/contact.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/curtain.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/humidifier.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/light_strip.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/lock.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/meter.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/motion.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/adv_parsers/plug.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/api_config.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/const.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/__init__.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/base_light.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/bot.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/bulb.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/ceiling_light.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/contact.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/curtain.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/humidifier.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/light_strip.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/lock.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/meter.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/motion.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/devices/plug.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/discovery.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/enum.py +0 -0
- {PySwitchbot-0.37.4 → PySwitchbot-0.37.6}/switchbot/models.py +0 -0
|
@@ -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
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|