violet-poolController-api 0.0.12__tar.gz → 0.0.16__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.
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/PKG-INFO +5 -5
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/pyproject.toml +46 -35
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/setup.py +5 -5
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/tests/test_api.py +75 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/violet_poolController_api.egg-info/PKG-INFO +5 -5
- violet_poolcontroller_api-0.0.16/violet_poolController_api.egg-info/requires.txt +6 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/violet_poolcontroller_api/api.py +201 -134
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/violet_poolcontroller_api/utils_rate_limiter.py +246 -250
- violet_poolcontroller_api-0.0.12/violet_poolController_api.egg-info/requires.txt +0 -6
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/LICENSE +0 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/README.md +0 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/setup.cfg +0 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/violet_poolController_api.egg-info/SOURCES.txt +0 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/violet_poolController_api.egg-info/dependency_links.txt +0 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/violet_poolController_api.egg-info/top_level.txt +0 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/violet_poolcontroller_api/__init__.py +0 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/violet_poolcontroller_api/circuit_breaker.py +0 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/violet_poolcontroller_api/const_api.py +0 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/violet_poolcontroller_api/const_devices.py +0 -0
- {violet_poolcontroller_api-0.0.12 → violet_poolcontroller_api-0.0.16}/violet_poolcontroller_api/utils_sanitizer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: violet-poolController-api
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.16
|
|
4
4
|
Summary: Asynchronous Python client for the Violet Pool Controller.
|
|
5
5
|
Home-page: https://github.com/Xerolux/violet-poolController-api
|
|
6
6
|
Author: Basti (Xerolux)
|
|
@@ -16,11 +16,11 @@ Classifier: Topic :: Home Automation
|
|
|
16
16
|
Requires-Python: >=3.12
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
|
-
Requires-Dist: aiohttp>=3.
|
|
19
|
+
Requires-Dist: aiohttp>=3.11.0
|
|
20
20
|
Provides-Extra: test
|
|
21
|
-
Requires-Dist: aioresponses>=0.7.
|
|
22
|
-
Requires-Dist: pytest>=8.
|
|
23
|
-
Requires-Dist: pytest-asyncio>=0.
|
|
21
|
+
Requires-Dist: aioresponses>=0.7.7; extra == "test"
|
|
22
|
+
Requires-Dist: pytest>=8.3; extra == "test"
|
|
23
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == "test"
|
|
24
24
|
Dynamic: author
|
|
25
25
|
Dynamic: home-page
|
|
26
26
|
Dynamic: license-file
|
|
@@ -1,35 +1,46 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=61.0.0", "wheel"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "violet-poolController-api"
|
|
7
|
-
version = "0.0.
|
|
8
|
-
authors = [
|
|
9
|
-
{ name="Basti (Xerolux)", email="git@xerolux.de" },
|
|
10
|
-
]
|
|
11
|
-
description = "Asynchronous Python client for the Violet Pool Controller."
|
|
12
|
-
readme = "README.md"
|
|
13
|
-
requires-python = ">=3.12"
|
|
14
|
-
license = { text = "AGPL-3.0-or-later" }
|
|
15
|
-
classifiers = [
|
|
16
|
-
"Programming Language :: Python :: 3",
|
|
17
|
-
"Operating System :: OS Independent",
|
|
18
|
-
"Intended Audience :: Developers",
|
|
19
|
-
"Topic :: Home Automation",
|
|
20
|
-
]
|
|
21
|
-
dependencies = [
|
|
22
|
-
"aiohttp>=3.
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
[project.optional-dependencies]
|
|
26
|
-
test = [
|
|
27
|
-
"aioresponses>=0.7.
|
|
28
|
-
"pytest>=8.
|
|
29
|
-
"pytest-asyncio>=0.
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
[project.urls]
|
|
33
|
-
"Homepage" = "https://github.com/Xerolux/violet-poolController-api"
|
|
34
|
-
"Bug Tracker" = "https://github.com/Xerolux/violet-poolController-api/issues"
|
|
35
|
-
"License" = "https://www.gnu.org/licenses/agpl-3.0.html"
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "violet-poolController-api"
|
|
7
|
+
version = "0.0.16"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Basti (Xerolux)", email="git@xerolux.de" },
|
|
10
|
+
]
|
|
11
|
+
description = "Asynchronous Python client for the Violet Pool Controller."
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.12"
|
|
14
|
+
license = { text = "AGPL-3.0-or-later" }
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Topic :: Home Automation",
|
|
20
|
+
]
|
|
21
|
+
dependencies = [
|
|
22
|
+
"aiohttp>=3.11.0",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.optional-dependencies]
|
|
26
|
+
test = [
|
|
27
|
+
"aioresponses>=0.7.7",
|
|
28
|
+
"pytest>=8.3",
|
|
29
|
+
"pytest-asyncio>=0.24",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
"Homepage" = "https://github.com/Xerolux/violet-poolController-api"
|
|
34
|
+
"Bug Tracker" = "https://github.com/Xerolux/violet-poolController-api/issues"
|
|
35
|
+
"License" = "https://www.gnu.org/licenses/agpl-3.0.html"
|
|
36
|
+
|
|
37
|
+
[tool.pytest.ini_options]
|
|
38
|
+
asyncio_mode = "auto"
|
|
39
|
+
|
|
40
|
+
[tool.ruff]
|
|
41
|
+
line-length = 100
|
|
42
|
+
target-version = "0.0.16"
|
|
43
|
+
|
|
44
|
+
[tool.ruff.lint]
|
|
45
|
+
select = ["E", "F", "W", "I", "UP"]
|
|
46
|
+
ignore = ["E501"]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from setuptools import setup, find_packages
|
|
2
2
|
setup(
|
|
3
3
|
name="violet-poolController-api",
|
|
4
|
-
version="0.0.
|
|
4
|
+
version="0.0.16",
|
|
5
5
|
author="Basti (Xerolux)",
|
|
6
6
|
author_email="git@xerolux.de",
|
|
7
7
|
description="Asynchronous Python client for the Violet Pool Controller.",
|
|
@@ -19,13 +19,13 @@ setup(
|
|
|
19
19
|
],
|
|
20
20
|
python_requires=">=3.12",
|
|
21
21
|
install_requires=[
|
|
22
|
-
"aiohttp>=3.
|
|
22
|
+
"aiohttp>=3.11.0",
|
|
23
23
|
],
|
|
24
24
|
extras_require={
|
|
25
25
|
"test": [
|
|
26
|
-
"aioresponses>=0.7.
|
|
27
|
-
"pytest>=8.
|
|
28
|
-
"pytest-asyncio>=0.
|
|
26
|
+
"aioresponses>=0.7.7",
|
|
27
|
+
"pytest>=8.3",
|
|
28
|
+
"pytest-asyncio>=0.24",
|
|
29
29
|
],
|
|
30
30
|
},
|
|
31
31
|
project_urls={
|
|
@@ -316,6 +316,81 @@ async def test_get_hardware_profile(mock_aioresponse, api_client):
|
|
|
316
316
|
assert profile["extension_module_1"] is True
|
|
317
317
|
assert profile["extension_module_2"] is False
|
|
318
318
|
|
|
319
|
+
@pytest.mark.asyncio
|
|
320
|
+
async def test_set_switch_state_ext1_relay(mock_aioresponse, api_client):
|
|
321
|
+
"""Test set_switch_state sends correct URL for EXT1_2 ON, OFF, and AUTO."""
|
|
322
|
+
base = "http://192.168.1.100/setFunctionManually"
|
|
323
|
+
|
|
324
|
+
mock_aioresponse.get(f"{base}?EXT1_2,ON,0,0", body="OK", status=200)
|
|
325
|
+
result = await api_client.set_switch_state("EXT1_2", "ON")
|
|
326
|
+
assert result["success"] is True
|
|
327
|
+
|
|
328
|
+
mock_aioresponse.get(f"{base}?EXT1_2,OFF,0,0", body="OK", status=200)
|
|
329
|
+
result = await api_client.set_switch_state("EXT1_2", "OFF")
|
|
330
|
+
assert result["success"] is True
|
|
331
|
+
|
|
332
|
+
mock_aioresponse.get(f"{base}?EXT1_2,AUTO,0,0", body="OK", status=200)
|
|
333
|
+
result = await api_client.set_switch_state("EXT1_2", "AUTO")
|
|
334
|
+
assert result["success"] is True
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
@pytest.mark.asyncio
|
|
338
|
+
async def test_module_alive_on_zero_count(mock_aioresponse, api_client):
|
|
339
|
+
"""EXT1 module must be detected when alive_count key is present but value is 0.
|
|
340
|
+
|
|
341
|
+
The alive counter starts at 0 immediately after a controller restart. The
|
|
342
|
+
old code required value > 0, which caused EXT1_* readings to be filtered
|
|
343
|
+
and the relay switch to appear broken right after a restart.
|
|
344
|
+
"""
|
|
345
|
+
url = "http://192.168.1.100/getReadings?ALL"
|
|
346
|
+
mock_aioresponse.get(url, payload={"getReadings": {
|
|
347
|
+
"PUMPSTATE": "2",
|
|
348
|
+
"SYSTEM_ext1module_alive_count": "0",
|
|
349
|
+
"EXT1_1": 0,
|
|
350
|
+
"EXT1_2": 0,
|
|
351
|
+
}}, status=200)
|
|
352
|
+
|
|
353
|
+
result = await api_client.get_readings()
|
|
354
|
+
assert "EXT1_2" in result, (
|
|
355
|
+
"EXT1_2 must not be filtered when SYSTEM_ext1module_alive_count is present, "
|
|
356
|
+
"even if the counter is still 0 after a restart"
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
@pytest.mark.asyncio
|
|
361
|
+
async def test_ext1_readings_not_filtered_when_detected(mock_aioresponse, api_client):
|
|
362
|
+
"""EXT1_* readings are included when extension_module_1 is detected."""
|
|
363
|
+
url = "http://192.168.1.100/getReadings?ALL"
|
|
364
|
+
mock_aioresponse.get(url, payload={"getReadings": {
|
|
365
|
+
"PUMPSTATE": "2",
|
|
366
|
+
"SYSTEM_ext1module_alive_count": "12345",
|
|
367
|
+
"EXT1_1": 1,
|
|
368
|
+
"EXT1_2": 0,
|
|
369
|
+
"EXT1_3": 0,
|
|
370
|
+
}}, status=200)
|
|
371
|
+
|
|
372
|
+
result = await api_client.get_readings()
|
|
373
|
+
assert "EXT1_1" in result
|
|
374
|
+
assert "EXT1_2" in result
|
|
375
|
+
assert "EXT1_3" in result
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
@pytest.mark.asyncio
|
|
379
|
+
async def test_ext1_readings_filtered_when_not_detected(mock_aioresponse, api_client):
|
|
380
|
+
"""EXT1_* readings are stripped when extension_module_1 key is absent."""
|
|
381
|
+
url = "http://192.168.1.100/getReadings?ALL"
|
|
382
|
+
mock_aioresponse.get(url, payload={"getReadings": {
|
|
383
|
+
"PUMPSTATE": "2",
|
|
384
|
+
# No SYSTEM_ext1module_alive_count → module not connected
|
|
385
|
+
"EXT1_1": 0,
|
|
386
|
+
"EXT1_2": 0,
|
|
387
|
+
}}, status=200)
|
|
388
|
+
|
|
389
|
+
result = await api_client.get_readings()
|
|
390
|
+
assert "EXT1_1" not in result
|
|
391
|
+
assert "EXT1_2" not in result
|
|
392
|
+
|
|
393
|
+
|
|
319
394
|
@pytest.mark.asyncio
|
|
320
395
|
async def test_get_hardware_profile_standalone_dosing(mock_aioresponse, standalone_api_client):
|
|
321
396
|
"""Test get_hardware_profile with a standalone dosing configuration."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: violet-poolController-api
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.16
|
|
4
4
|
Summary: Asynchronous Python client for the Violet Pool Controller.
|
|
5
5
|
Home-page: https://github.com/Xerolux/violet-poolController-api
|
|
6
6
|
Author: Basti (Xerolux)
|
|
@@ -16,11 +16,11 @@ Classifier: Topic :: Home Automation
|
|
|
16
16
|
Requires-Python: >=3.12
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
|
-
Requires-Dist: aiohttp>=3.
|
|
19
|
+
Requires-Dist: aiohttp>=3.11.0
|
|
20
20
|
Provides-Extra: test
|
|
21
|
-
Requires-Dist: aioresponses>=0.7.
|
|
22
|
-
Requires-Dist: pytest>=8.
|
|
23
|
-
Requires-Dist: pytest-asyncio>=0.
|
|
21
|
+
Requires-Dist: aioresponses>=0.7.7; extra == "test"
|
|
22
|
+
Requires-Dist: pytest>=8.3; extra == "test"
|
|
23
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == "test"
|
|
24
24
|
Dynamic: author
|
|
25
25
|
Dynamic: home-page
|
|
26
26
|
Dynamic: license-file
|