python-homely 0.1.3__tar.gz → 0.1.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-homely
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Async Python client for the Homely cloud API, built for Home Assistant but usable anywhere.
5
5
  Author: Ludvik Blichfeldt Rød
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-homely"
7
- version = "0.1.3"
7
+ version = "0.1.4"
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")
@@ -397,7 +403,7 @@ class HomelyWebSocket:
397
403
  await asyncio.wait_for(
398
404
  self.socket.connect(
399
405
  url,
400
- transports=["websocket", "polling"],
406
+ transports=["websocket"],
401
407
  headers={"Authorization": bearer_token},
402
408
  ),
403
409
  timeout=10,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-homely
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Async Python client for the Homely cloud API, built for Home Assistant but usable anywhere.
5
5
  Author: Ludvik Blichfeldt Rød
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes