python-rako-2025 0.4.0__tar.gz → 0.4.3__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 (47) hide show
  1. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/PKG-INFO +50 -31
  2. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/README.md +48 -29
  3. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/pyproject.toml +1 -1
  4. python_rako_2025-0.4.3/python_rako/__version__.py +1 -0
  5. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/python_rako/bridge.py +8 -1
  6. python_rako_2025-0.4.0/python_rako/__version__.py +0 -1
  7. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.claude/settings.local.json +0 -0
  8. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.coveragerc +0 -0
  9. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.editorconfig +0 -0
  10. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.flake8 +0 -0
  11. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.gitattributes +0 -0
  12. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.github/dependabot.yml +0 -0
  13. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.github/workflows/ci.yml +0 -0
  14. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.github/workflows/release.yml +0 -0
  15. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.gitignore +0 -0
  16. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.isort.cfg +0 -0
  17. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.pre-commit-config.yaml +0 -0
  18. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/.yamllint +0 -0
  19. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/LICENSE +0 -0
  20. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/Makefile +0 -0
  21. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/catalog-info.yaml +0 -0
  22. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/conftest.py +0 -0
  23. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/doc/accessing-the-rako-bridge.pdf +0 -0
  24. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/examples/discover_all_devices.py +0 -0
  25. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/examples/example.py +0 -0
  26. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/examples/ventilation_example.py +0 -0
  27. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/examples/view_updates.py +0 -0
  28. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/python_rako/__init__.py +0 -0
  29. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/python_rako/const.py +0 -0
  30. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/python_rako/exceptions.py +0 -0
  31. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/python_rako/helpers.py +0 -0
  32. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/python_rako/model.py +0 -0
  33. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/python_rako/py.typed +0 -0
  34. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests/README_TESTING.md +0 -0
  35. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests/resources/rako.xml +0 -0
  36. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests/resources/rako2.xml +0 -0
  37. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests/resources/rako3.xml +0 -0
  38. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests/test_async_lock.py +0 -0
  39. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests/test_bridge.py +0 -0
  40. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests/test_edge_cases.py +0 -0
  41. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests/test_helpers.py +0 -0
  42. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests/test_model.py +0 -0
  43. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests/test_xml_parsing.py +0 -0
  44. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests_integration/__init__.py +0 -0
  45. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests_integration/conftest.py +0 -0
  46. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests_integration/test_command_live.py +0 -0
  47. {python_rako_2025-0.4.0 → python_rako_2025-0.4.3}/tests_integration/test_general_live.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-rako-2025
3
- Version: 0.4.0
3
+ Version: 0.4.3
4
4
  Summary: Asynchronous Python client for Rako Controls Lighting
5
5
  Project-URL: Homepage, https://github.com/simonleigh/python-rako
6
6
  Project-URL: Repository, https://github.com/simonleigh/python-rako
@@ -23,7 +23,7 @@ Classifier: Topic :: Home Automation
23
23
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
24
  Classifier: Typing :: Typed
25
25
  Requires-Python: >=3.12
26
- Requires-Dist: aiohttp>=3.12.0
26
+ Requires-Dist: aiohttp>=3.11.12
27
27
  Requires-Dist: asyncio-dgram>=2.2.0
28
28
  Requires-Dist: xmltodict>=0.14.0
29
29
  Provides-Extra: dev
@@ -48,10 +48,11 @@ Description-Content-Type: text/markdown
48
48
  [![Code Coverage][codecov-shield]][codecov]
49
49
  [![Code Quality][code-quality-shield]][code-quality]
50
50
 
51
- [![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
52
51
 
53
52
  Asynchronous Python client for Rako Controls.
54
53
 
54
+ **This is a modernized fork** that has been updated to Python 3.12+ best practices, includes async concurrency fixes for Home Assistant integration, and uses modern tooling (Ruff, Hatchling, etc.).
55
+
55
56
  ## About
56
57
 
57
58
  This package allows you to control and monitor Rako Controls devices
@@ -61,23 +62,42 @@ their behavior.
61
62
  ## Installation
62
63
 
63
64
  ```bash
64
- pip install python-rako
65
+ pip install python-rako-2025
65
66
  ```
66
67
 
67
68
  ## Usage
68
69
 
69
70
  ```python
70
71
  import asyncio
72
+ import aiohttp
73
+ from python_rako import discover_bridge, Bridge
71
74
 
72
75
 
73
76
  async def main():
74
- # TODO
75
- pass
77
+ # Discover bridge on network
78
+ bridge_info = await discover_bridge()
79
+ print(f"Found bridge: {bridge_info}")
80
+
81
+ # Create bridge instance
82
+ bridge = Bridge(
83
+ host=bridge_info["host"],
84
+ port=bridge_info["port"],
85
+ name=bridge_info["name"],
86
+ mac=bridge_info["mac"]
87
+ )
88
+
89
+ # Get bridge information and discover devices
90
+ async with aiohttp.ClientSession() as session:
91
+ info = await bridge.get_info(session)
92
+ print(f"Bridge version: {info.version}")
93
+
94
+ # Discover all lights
95
+ async for light in bridge.discover_lights(session):
96
+ print(f"Found light: {light.title} (Room {light.room_id})")
76
97
 
77
98
 
78
99
  if __name__ == "__main__":
79
- loop = asyncio.get_event_loop()
80
- loop.run_until_complete(main())
100
+ asyncio.run(main())
81
101
  ```
82
102
 
83
103
  ## Changelog & Releases
@@ -125,11 +145,10 @@ Asynchronous Python client for Rako Controls Lighting.
125
145
  Usage:
126
146
  make help Shows this message.
127
147
  make dev Set up a development environment.
128
- make lint Run all linters.
129
- make lint-black Run linting using black & blacken-docs.
130
- make lint-flake8 Run linting using flake8 (pycodestyle/pydocstyle).
131
- make lint-pylint Run linting using PyLint.
132
- make lint-mypy Run linting using MyPy.
148
+ make lint Run Ruff linting and formatting checks.
149
+ make format Format code with Ruff.
150
+ make typecheck Run type checking with MyPy.
151
+ make check Run all checks (linting, formatting, and type checking).
133
152
  make test Run tests quickly with the default Python.
134
153
  make coverage Check code coverage quickly with the default Python.
135
154
  make install Install the package to the active Python's site-packages.
@@ -140,13 +159,17 @@ Usage:
140
159
  make clean-test Removes test and coverage artifacts.
141
160
  make clean-venv Removes Python virtual environment artifacts.
142
161
  make dist Builds source and wheel package.
143
- make release Release build on PyP
162
+ make release Release build on PyPI.
144
163
  make venv Create Python venv environment.
164
+ make bump-patch Bump patch version (x.y.Z) and commit.
165
+ make bump-minor Bump minor version (x.Y.z) and commit.
166
+ make bump-major Bump major version (X.y.z) and commit.
145
167
  ```
146
168
 
147
169
  ## Authors & contributors
148
170
 
149
171
  The original setup of this repository is by [Ben Marengo][marengaz].
172
+ Currently maintained by [Simon Leigh][simonleigh].
150
173
 
151
174
  For a full list of all authors and contributors,
152
175
  check [the contributor's page][contributors].
@@ -155,23 +178,19 @@ check [the contributor's page][contributors].
155
178
 
156
179
  [License](LICENSE)
157
180
 
158
- [build-shield]: https://github.com/marengaz/python-rako/workflows/Continuous%20Integration/badge.svg
159
- [build]: https://github.com/marengaz/python-rako/actions
160
- [code-quality-shield]: https://img.shields.io/lgtm/grade/python/g/marengaz/python-rako.svg?logo=lgtm&logoWidth=18
161
- [code-quality]: https://lgtm.com/projects/g/marengaz/python-rako/context:python
162
- [codecov-shield]: https://codecov.io/gh/marengaz/python-rako/branch/master/graph/badge.svg
163
- [codecov]: https://codecov.io/gh/marengaz/python-rako
164
- [contributors]: https://github.com/marengaz/python-rako/graphs/contributors
181
+ [build-shield]: https://github.com/simonleigh/python-rako/workflows/Continuous%20Integration/badge.svg
182
+ [build]: https://github.com/simonleigh/python-rako/actions
183
+ [code-quality-shield]: https://img.shields.io/lgtm/grade/python/g/simonleigh/python-rako.svg?logo=lgtm&logoWidth=18
184
+ [code-quality]: https://lgtm.com/projects/g/simonleigh/python-rako/context:python
185
+ [codecov-shield]: https://codecov.io/gh/simonleigh/python-rako/branch/master/graph/badge.svg
186
+ [codecov]: https://codecov.io/gh/simonleigh/python-rako
187
+ [contributors]: https://github.com/simonleigh/python-rako/graphs/contributors
165
188
  [marengaz]: https://github.com/marengaz
189
+ [simonleigh]: https://github.com/simonleigh
166
190
  [keepchangelog]: http://keepachangelog.com/en/1.0.0/
167
- [license-shield]: https://img.shields.io/github/license/marengaz/python-rako.svg
168
- [maintenance-shield]: https://img.shields.io/maintenance/yes/2021.svg
169
- [project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
170
- [releases-shield]: https://img.shields.io/github/release/marengaz/python-rako.svg
171
- [releases]: https://github.com/marengaz/python-rako/releases
191
+ [license-shield]: https://img.shields.io/github/license/simonleigh/python-rako.svg
192
+ [maintenance-shield]: https://img.shields.io/maintenance/yes/2025.svg
193
+ [project-stage-shield]: https://img.shields.io/badge/project%20stage-stable-green.svg
194
+ [releases-shield]: https://img.shields.io/github/release/simonleigh/python-rako.svg
195
+ [releases]: https://github.com/simonleigh/python-rako/releases
172
196
  [semver]: http://semver.org/spec/v2.0.0.html
173
-
174
- [buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
175
- [buymeacoffee]: https://www.buymeacoffee.com/marengaz
176
- [github-actions-shield]: https://github.com/marengaz/rakomqtt/workflows/Test%20RakoMQTT/badge.svg?branch=master
177
- [github-actions]: https://github.com/marengaz/rakomqtt/actions?query=workflow%3A%22Test+RakoMQTT%22+branch%3Amaster
@@ -9,10 +9,11 @@
9
9
  [![Code Coverage][codecov-shield]][codecov]
10
10
  [![Code Quality][code-quality-shield]][code-quality]
11
11
 
12
- [![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
13
12
 
14
13
  Asynchronous Python client for Rako Controls.
15
14
 
15
+ **This is a modernized fork** that has been updated to Python 3.12+ best practices, includes async concurrency fixes for Home Assistant integration, and uses modern tooling (Ruff, Hatchling, etc.).
16
+
16
17
  ## About
17
18
 
18
19
  This package allows you to control and monitor Rako Controls devices
@@ -22,23 +23,42 @@ their behavior.
22
23
  ## Installation
23
24
 
24
25
  ```bash
25
- pip install python-rako
26
+ pip install python-rako-2025
26
27
  ```
27
28
 
28
29
  ## Usage
29
30
 
30
31
  ```python
31
32
  import asyncio
33
+ import aiohttp
34
+ from python_rako import discover_bridge, Bridge
32
35
 
33
36
 
34
37
  async def main():
35
- # TODO
36
- pass
38
+ # Discover bridge on network
39
+ bridge_info = await discover_bridge()
40
+ print(f"Found bridge: {bridge_info}")
41
+
42
+ # Create bridge instance
43
+ bridge = Bridge(
44
+ host=bridge_info["host"],
45
+ port=bridge_info["port"],
46
+ name=bridge_info["name"],
47
+ mac=bridge_info["mac"]
48
+ )
49
+
50
+ # Get bridge information and discover devices
51
+ async with aiohttp.ClientSession() as session:
52
+ info = await bridge.get_info(session)
53
+ print(f"Bridge version: {info.version}")
54
+
55
+ # Discover all lights
56
+ async for light in bridge.discover_lights(session):
57
+ print(f"Found light: {light.title} (Room {light.room_id})")
37
58
 
38
59
 
39
60
  if __name__ == "__main__":
40
- loop = asyncio.get_event_loop()
41
- loop.run_until_complete(main())
61
+ asyncio.run(main())
42
62
  ```
43
63
 
44
64
  ## Changelog & Releases
@@ -86,11 +106,10 @@ Asynchronous Python client for Rako Controls Lighting.
86
106
  Usage:
87
107
  make help Shows this message.
88
108
  make dev Set up a development environment.
89
- make lint Run all linters.
90
- make lint-black Run linting using black & blacken-docs.
91
- make lint-flake8 Run linting using flake8 (pycodestyle/pydocstyle).
92
- make lint-pylint Run linting using PyLint.
93
- make lint-mypy Run linting using MyPy.
109
+ make lint Run Ruff linting and formatting checks.
110
+ make format Format code with Ruff.
111
+ make typecheck Run type checking with MyPy.
112
+ make check Run all checks (linting, formatting, and type checking).
94
113
  make test Run tests quickly with the default Python.
95
114
  make coverage Check code coverage quickly with the default Python.
96
115
  make install Install the package to the active Python's site-packages.
@@ -101,13 +120,17 @@ Usage:
101
120
  make clean-test Removes test and coverage artifacts.
102
121
  make clean-venv Removes Python virtual environment artifacts.
103
122
  make dist Builds source and wheel package.
104
- make release Release build on PyP
123
+ make release Release build on PyPI.
105
124
  make venv Create Python venv environment.
125
+ make bump-patch Bump patch version (x.y.Z) and commit.
126
+ make bump-minor Bump minor version (x.Y.z) and commit.
127
+ make bump-major Bump major version (X.y.z) and commit.
106
128
  ```
107
129
 
108
130
  ## Authors & contributors
109
131
 
110
132
  The original setup of this repository is by [Ben Marengo][marengaz].
133
+ Currently maintained by [Simon Leigh][simonleigh].
111
134
 
112
135
  For a full list of all authors and contributors,
113
136
  check [the contributor's page][contributors].
@@ -116,23 +139,19 @@ check [the contributor's page][contributors].
116
139
 
117
140
  [License](LICENSE)
118
141
 
119
- [build-shield]: https://github.com/marengaz/python-rako/workflows/Continuous%20Integration/badge.svg
120
- [build]: https://github.com/marengaz/python-rako/actions
121
- [code-quality-shield]: https://img.shields.io/lgtm/grade/python/g/marengaz/python-rako.svg?logo=lgtm&logoWidth=18
122
- [code-quality]: https://lgtm.com/projects/g/marengaz/python-rako/context:python
123
- [codecov-shield]: https://codecov.io/gh/marengaz/python-rako/branch/master/graph/badge.svg
124
- [codecov]: https://codecov.io/gh/marengaz/python-rako
125
- [contributors]: https://github.com/marengaz/python-rako/graphs/contributors
142
+ [build-shield]: https://github.com/simonleigh/python-rako/workflows/Continuous%20Integration/badge.svg
143
+ [build]: https://github.com/simonleigh/python-rako/actions
144
+ [code-quality-shield]: https://img.shields.io/lgtm/grade/python/g/simonleigh/python-rako.svg?logo=lgtm&logoWidth=18
145
+ [code-quality]: https://lgtm.com/projects/g/simonleigh/python-rako/context:python
146
+ [codecov-shield]: https://codecov.io/gh/simonleigh/python-rako/branch/master/graph/badge.svg
147
+ [codecov]: https://codecov.io/gh/simonleigh/python-rako
148
+ [contributors]: https://github.com/simonleigh/python-rako/graphs/contributors
126
149
  [marengaz]: https://github.com/marengaz
150
+ [simonleigh]: https://github.com/simonleigh
127
151
  [keepchangelog]: http://keepachangelog.com/en/1.0.0/
128
- [license-shield]: https://img.shields.io/github/license/marengaz/python-rako.svg
129
- [maintenance-shield]: https://img.shields.io/maintenance/yes/2021.svg
130
- [project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
131
- [releases-shield]: https://img.shields.io/github/release/marengaz/python-rako.svg
132
- [releases]: https://github.com/marengaz/python-rako/releases
152
+ [license-shield]: https://img.shields.io/github/license/simonleigh/python-rako.svg
153
+ [maintenance-shield]: https://img.shields.io/maintenance/yes/2025.svg
154
+ [project-stage-shield]: https://img.shields.io/badge/project%20stage-stable-green.svg
155
+ [releases-shield]: https://img.shields.io/github/release/simonleigh/python-rako.svg
156
+ [releases]: https://github.com/simonleigh/python-rako/releases
133
157
  [semver]: http://semver.org/spec/v2.0.0.html
134
-
135
- [buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
136
- [buymeacoffee]: https://www.buymeacoffee.com/marengaz
137
- [github-actions-shield]: https://github.com/marengaz/rakomqtt/workflows/Test%20RakoMQTT/badge.svg?branch=master
138
- [github-actions]: https://github.com/marengaz/rakomqtt/actions?query=workflow%3A%22Test+RakoMQTT%22+branch%3Amaster
@@ -29,7 +29,7 @@ classifiers = [
29
29
  ]
30
30
  requires-python = ">=3.12"
31
31
  dependencies = [
32
- "aiohttp>=3.12.0",
32
+ "aiohttp>=3.11.12",
33
33
  "asyncio-dgram>=2.2.0",
34
34
  "xmltodict>=0.14.0",
35
35
  ]
@@ -0,0 +1 @@
1
+ __version__ = "0.4.3"
@@ -94,7 +94,14 @@ class BridgeCommanderUDP(_BridgeCommander):
94
94
  await dg_client.send(bytes(byte_list))
95
95
  data, _ = await dg_client.recv()
96
96
 
97
- if data.decode("utf8").strip() != COMMAND_SUCCESS_RESPONSE:
97
+ # Rako bridges return responses in Windows-1252 encoding, not UTF-8
98
+ try:
99
+ decoded_data = data.decode("windows-1252").strip()
100
+ except UnicodeDecodeError:
101
+ # Fallback to latin-1 which accepts all byte values
102
+ decoded_data = data.decode("latin-1").strip()
103
+
104
+ if decoded_data != COMMAND_SUCCESS_RESPONSE:
98
105
  _LOGGER.warning("Bad response after command %s %s", command, data)
99
106
 
100
107
 
@@ -1 +0,0 @@
1
- __version__ = "0.4.0"