python-homely 0.1.3__tar.gz → 0.1.5__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.
- {python_homely-0.1.3/src/python_homely.egg-info → python_homely-0.1.5}/PKG-INFO +1 -1
- {python_homely-0.1.3 → python_homely-0.1.5}/pyproject.toml +1 -1
- {python_homely-0.1.3 → python_homely-0.1.5}/src/homely/__init__.py +1 -1
- {python_homely-0.1.3 → python_homely-0.1.5}/src/homely/websocket.py +8 -3
- {python_homely-0.1.3 → python_homely-0.1.5/src/python_homely.egg-info}/PKG-INFO +1 -1
- {python_homely-0.1.3 → python_homely-0.1.5}/LICENSE +0 -0
- {python_homely-0.1.3 → python_homely-0.1.5}/README.md +0 -0
- {python_homely-0.1.3 → python_homely-0.1.5}/setup.cfg +0 -0
- {python_homely-0.1.3 → python_homely-0.1.5}/src/homely/client.py +0 -0
- {python_homely-0.1.3 → python_homely-0.1.5}/src/homely/exceptions.py +0 -0
- {python_homely-0.1.3 → python_homely-0.1.5}/src/homely/models.py +0 -0
- {python_homely-0.1.3 → python_homely-0.1.5}/src/homely/py.typed +0 -0
- {python_homely-0.1.3 → python_homely-0.1.5}/src/python_homely.egg-info/SOURCES.txt +0 -0
- {python_homely-0.1.3 → python_homely-0.1.5}/src/python_homely.egg-info/dependency_links.txt +0 -0
- {python_homely-0.1.3 → python_homely-0.1.5}/src/python_homely.egg-info/requires.txt +0 -0
- {python_homely-0.1.3 → python_homely-0.1.5}/src/python_homely.egg-info/top_level.txt +0 -0
- {python_homely-0.1.3 → python_homely-0.1.5}/tests/test_sdk.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-homely"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.5"
|
|
8
8
|
description = "Async Python client for the Homely cloud API, built for Home Assistant but usable anywhere."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -98,6 +98,7 @@ class HomelyWebSocket:
|
|
|
98
98
|
self.on_data_update = on_data_update
|
|
99
99
|
self.socket: Any | None = None
|
|
100
100
|
self._is_closing = False
|
|
101
|
+
self._cleaning_up_socket = False
|
|
101
102
|
self._reconnect_task: asyncio.Task[None] | None = None
|
|
102
103
|
self._reconnect_interval = self._reconnect_interval_for_attempt(1)
|
|
103
104
|
self._reconnect_warn_every = 12
|
|
@@ -248,6 +249,8 @@ class HomelyWebSocket:
|
|
|
248
249
|
if self._is_closing:
|
|
249
250
|
self._set_status("Disconnected", "manual disconnect")
|
|
250
251
|
return
|
|
252
|
+
if self._cleaning_up_socket:
|
|
253
|
+
return
|
|
251
254
|
self._set_status("Disconnected", reason)
|
|
252
255
|
if not self._is_closing:
|
|
253
256
|
self._start_reconnect_loop("disconnect event")
|
|
@@ -341,10 +344,13 @@ class HomelyWebSocket:
|
|
|
341
344
|
return True
|
|
342
345
|
|
|
343
346
|
if self.socket is not None:
|
|
347
|
+
self._cleaning_up_socket = True
|
|
344
348
|
try:
|
|
345
349
|
await asyncio.wait_for(self.socket.disconnect(), timeout=2)
|
|
346
350
|
except Exception:
|
|
347
351
|
pass
|
|
352
|
+
finally:
|
|
353
|
+
self._cleaning_up_socket = False
|
|
348
354
|
self.socket = None
|
|
349
355
|
|
|
350
356
|
self._set_status("Connecting")
|
|
@@ -352,7 +358,7 @@ class HomelyWebSocket:
|
|
|
352
358
|
self.socket = socketio.AsyncClient(
|
|
353
359
|
reconnection=False,
|
|
354
360
|
logger=False,
|
|
355
|
-
engineio_logger=
|
|
361
|
+
engineio_logger=logging.getLogger("engineio.client"),
|
|
356
362
|
)
|
|
357
363
|
|
|
358
364
|
async def connect() -> None:
|
|
@@ -397,7 +403,7 @@ class HomelyWebSocket:
|
|
|
397
403
|
await asyncio.wait_for(
|
|
398
404
|
self.socket.connect(
|
|
399
405
|
url,
|
|
400
|
-
transports=["
|
|
406
|
+
transports=["polling", "websocket"],
|
|
401
407
|
headers={"Authorization": bearer_token},
|
|
402
408
|
),
|
|
403
409
|
timeout=10,
|
|
@@ -444,7 +450,6 @@ class HomelyWebSocket:
|
|
|
444
450
|
self.socket = None
|
|
445
451
|
finally:
|
|
446
452
|
self._set_status("Disconnected", "manual disconnect")
|
|
447
|
-
self._is_closing = False
|
|
448
453
|
|
|
449
454
|
async def close(self) -> None:
|
|
450
455
|
"""Alias for disconnect, matching common client-library conventions."""
|
|
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
|