python-rako-2025 0.3.8__tar.gz → 0.3.9__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 (23) hide show
  1. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/PKG-INFO +1 -1
  2. python_rako_2025-0.3.9/python_rako/__version__.py +1 -0
  3. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako/bridge.py +8 -2
  4. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako_2025.egg-info/PKG-INFO +1 -1
  5. python_rako_2025-0.3.8/python_rako/__version__.py +0 -1
  6. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/LICENSE +0 -0
  7. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/README.md +0 -0
  8. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/pyproject.toml +0 -0
  9. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako/__init__.py +0 -0
  10. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako/const.py +0 -0
  11. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako/exceptions.py +0 -0
  12. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako/helpers.py +0 -0
  13. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako/model.py +0 -0
  14. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako/py.typed +0 -0
  15. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako_2025.egg-info/SOURCES.txt +0 -0
  16. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako_2025.egg-info/dependency_links.txt +0 -0
  17. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako_2025.egg-info/requires.txt +0 -0
  18. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/python_rako_2025.egg-info/top_level.txt +0 -0
  19. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/setup.cfg +0 -0
  20. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/setup.py +0 -0
  21. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/tests/test_bridge.py +0 -0
  22. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/tests/test_helpers.py +0 -0
  23. {python_rako_2025-0.3.8 → python_rako_2025-0.3.9}/tests/test_model.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-rako-2025
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Summary: Asynchronous Python client for Rako Controls Lighting
5
5
  Author-email: Simon Leigh <simonleigh@users.noreply.github.com>
6
6
  Project-URL: Homepage, https://github.com/simonleigh/python-rako
@@ -0,0 +1 @@
1
+ 0.3.9
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import asyncio
4
4
  import logging
5
+ import threading
5
6
  from collections.abc import AsyncGenerator, Generator
6
7
  from typing import Any
7
8
 
@@ -39,6 +40,9 @@ from python_rako.model import (
39
40
 
40
41
  _LOGGER = logging.getLogger(__name__)
41
42
 
43
+ # Thread lock for XML parsing to ensure concurrency safety
44
+ _XML_PARSE_LOCK = threading.Lock()
45
+
42
46
 
43
47
  class _BridgeCommander:
44
48
  def __init__(self, host: str, port: int):
@@ -227,7 +231,8 @@ class Bridge:
227
231
 
228
232
  @staticmethod
229
233
  def get_bridge_info_from_discovery_xml(xml: str) -> BridgeInfo:
230
- xml_dict = xmltodict.parse(xml)
234
+ with _XML_PARSE_LOCK:
235
+ xml_dict = xmltodict.parse(xml)
231
236
  info = xml_dict["rako"].get("info", dict())
232
237
  config = xml_dict["rako"].get("config", dict())
233
238
  return BridgeInfo(
@@ -270,7 +275,8 @@ class Bridge:
270
275
  else:
271
276
  target_types = set(device_types)
272
277
 
273
- xml_dict = xmltodict.parse(xml, force_list={"Room"})
278
+ with _XML_PARSE_LOCK:
279
+ xml_dict = xmltodict.parse(xml, force_list={"Room"})
274
280
  for room in xml_dict["rako"]["rooms"]["Room"]:
275
281
  room_id = int(room["@id"])
276
282
  room_type = room.get("Type", "Lights")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-rako-2025
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Summary: Asynchronous Python client for Rako Controls Lighting
5
5
  Author-email: Simon Leigh <simonleigh@users.noreply.github.com>
6
6
  Project-URL: Homepage, https://github.com/simonleigh/python-rako
@@ -1 +0,0 @@
1
- 0.3.8