ips-api-client 0.1.0__tar.gz → 0.1.1__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.
- {ips_api_client-0.1.0/ips_api_client.egg-info → ips_api_client-0.1.1}/PKG-INFO +11 -12
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/README.md +2 -0
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/ips_api/__init__.py +1 -1
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/ips_api/client.py +7 -1
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/ips_api/models.py +1 -0
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/ips_api/parser.py +22 -7
- {ips_api_client-0.1.0 → ips_api_client-0.1.1/ips_api_client.egg-info}/PKG-INFO +11 -12
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/ips_api_client.egg-info/SOURCES.txt +0 -1
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/setup.py +1 -1
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/tests/test_client.py +1 -0
- ips_api_client-0.1.0/pyproject.toml +0 -41
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/CHANGELOG.md +0 -0
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/LICENSE +0 -0
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/MANIFEST.in +0 -0
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/ips_api/const.py +0 -0
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/ips_api/exceptions.py +0 -0
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/ips_api_client.egg-info/dependency_links.txt +0 -0
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/ips_api_client.egg-info/requires.txt +0 -0
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/ips_api_client.egg-info/top_level.txt +0 -0
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/requirements.txt +0 -0
- {ips_api_client-0.1.0 → ips_api_client-0.1.1}/setup.cfg +0 -0
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ips-api-client
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: API client for IPS Controllers pool monitoring system
|
|
5
5
|
Home-page: https://github.com/stgarrity/ips-api-client
|
|
6
6
|
Author: Steve Garrity
|
|
7
|
-
Author-email:
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Homepage, https://github.com/stgarrity/ips-api-client
|
|
10
|
-
Project-URL: Documentation, https://github.com/stgarrity/ips-api-client#readme
|
|
11
|
-
Project-URL: Repository, https://github.com/stgarrity/ips-api-client
|
|
12
|
-
Project-URL: Issues, https://github.com/stgarrity/ips-api-client/issues
|
|
13
|
-
Keywords: ips,pool,chemistry,monitoring,home-assistant
|
|
7
|
+
Author-email: sgarrity@gmail.com
|
|
14
8
|
Classifier: Development Status :: 3 - Alpha
|
|
15
9
|
Classifier: Intended Audience :: Developers
|
|
16
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -19,18 +13,21 @@ Classifier: Programming Language :: Python :: 3
|
|
|
19
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
20
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
-
Classifier: Topic :: Home Automation
|
|
24
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
16
|
Requires-Python: >=3.9
|
|
26
17
|
Description-Content-Type: text/markdown
|
|
27
18
|
License-File: LICENSE
|
|
28
19
|
Requires-Dist: aiohttp>=3.8.0
|
|
29
20
|
Requires-Dist: beautifulsoup4>=4.11.0
|
|
30
21
|
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: description
|
|
25
|
+
Dynamic: description-content-type
|
|
31
26
|
Dynamic: home-page
|
|
32
27
|
Dynamic: license-file
|
|
28
|
+
Dynamic: requires-dist
|
|
33
29
|
Dynamic: requires-python
|
|
30
|
+
Dynamic: summary
|
|
34
31
|
|
|
35
32
|
# IPS Controllers API Client
|
|
36
33
|
|
|
@@ -62,6 +59,7 @@ async def main():
|
|
|
62
59
|
# Get detailed reading
|
|
63
60
|
detail = await client.get_controller_detail(controller.controller_id)
|
|
64
61
|
print(f" pH Setpoint: {detail.ph_setpoint}")
|
|
62
|
+
print(f" ORP Setpoint: {detail.orp_setpoint}")
|
|
65
63
|
print(f" pH State: {detail.ph_state}")
|
|
66
64
|
|
|
67
65
|
asyncio.run(main())
|
|
@@ -84,6 +82,7 @@ asyncio.run(main())
|
|
|
84
82
|
- Controller status
|
|
85
83
|
- Last reading timestamp
|
|
86
84
|
- pH setpoint and state
|
|
85
|
+
- ORP setpoint
|
|
87
86
|
|
|
88
87
|
## License
|
|
89
88
|
|
|
@@ -28,6 +28,7 @@ async def main():
|
|
|
28
28
|
# Get detailed reading
|
|
29
29
|
detail = await client.get_controller_detail(controller.controller_id)
|
|
30
30
|
print(f" pH Setpoint: {detail.ph_setpoint}")
|
|
31
|
+
print(f" ORP Setpoint: {detail.orp_setpoint}")
|
|
31
32
|
print(f" pH State: {detail.ph_state}")
|
|
32
33
|
|
|
33
34
|
asyncio.run(main())
|
|
@@ -50,6 +51,7 @@ asyncio.run(main())
|
|
|
50
51
|
- Controller status
|
|
51
52
|
- Last reading timestamp
|
|
52
53
|
- pH setpoint and state
|
|
54
|
+
- ORP setpoint
|
|
53
55
|
|
|
54
56
|
## License
|
|
55
57
|
|
|
@@ -213,7 +213,13 @@ class IPSClient:
|
|
|
213
213
|
raise SessionExpiredError("Session has expired")
|
|
214
214
|
|
|
215
215
|
reading = parse_device_detail(html)
|
|
216
|
-
_LOGGER.debug(
|
|
216
|
+
_LOGGER.debug(
|
|
217
|
+
"Retrieved reading: pH=%s, ORP=%s, pH setpoint=%s, ORP setpoint=%s",
|
|
218
|
+
reading.ph,
|
|
219
|
+
reading.orp,
|
|
220
|
+
reading.ph_setpoint,
|
|
221
|
+
reading.orp_setpoint,
|
|
222
|
+
)
|
|
217
223
|
|
|
218
224
|
return reading
|
|
219
225
|
|
|
@@ -112,6 +112,18 @@ def parse_int(value: str) -> Optional[int]:
|
|
|
112
112
|
return None
|
|
113
113
|
|
|
114
114
|
|
|
115
|
+
def extract_first_number(value: str) -> Optional[str]:
|
|
116
|
+
"""Extract the first numeric token from a string."""
|
|
117
|
+
if not value or not value.strip():
|
|
118
|
+
return None
|
|
119
|
+
|
|
120
|
+
match = re.search(r'([0-9]+(?:\.[0-9]+)?)', value)
|
|
121
|
+
if not match:
|
|
122
|
+
return None
|
|
123
|
+
|
|
124
|
+
return match.group(1)
|
|
125
|
+
|
|
126
|
+
|
|
115
127
|
def extract_status_from_icon(img_src: str) -> str:
|
|
116
128
|
"""Extract status from icon filename.
|
|
117
129
|
|
|
@@ -245,15 +257,17 @@ def parse_device_detail(html: str) -> PoolReading:
|
|
|
245
257
|
temp_elem = soup.find('span', id='lblTempValue')
|
|
246
258
|
ph_state_elem = soup.find('span', id='lblpHState')
|
|
247
259
|
ph_setpoint_elem = soup.find('span', id='lblphSetpoint')
|
|
260
|
+
orp_setpoint_elem = soup.find('span', id='lblorpSetpoint')
|
|
248
261
|
timestamp_elem = soup.find('span', id='lblLastReading')
|
|
249
262
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
if
|
|
256
|
-
|
|
263
|
+
ph_setpoint = parse_float(
|
|
264
|
+
extract_first_number(ph_setpoint_elem.get_text() if ph_setpoint_elem else '')
|
|
265
|
+
or ''
|
|
266
|
+
)
|
|
267
|
+
orp_setpoint = parse_int(
|
|
268
|
+
extract_first_number(orp_setpoint_elem.get_text() if orp_setpoint_elem else '')
|
|
269
|
+
or ''
|
|
270
|
+
)
|
|
257
271
|
|
|
258
272
|
reading = PoolReading(
|
|
259
273
|
ph=parse_float(ph_elem.get_text() if ph_elem else ''),
|
|
@@ -261,6 +275,7 @@ def parse_device_detail(html: str) -> PoolReading:
|
|
|
261
275
|
temperature=parse_float(temp_elem.get_text() if temp_elem else ''),
|
|
262
276
|
ph_state=ph_state_elem.get_text(strip=True) if ph_state_elem else None,
|
|
263
277
|
ph_setpoint=ph_setpoint,
|
|
278
|
+
orp_setpoint=orp_setpoint,
|
|
264
279
|
timestamp=parse_datetime(timestamp_elem.get_text() if timestamp_elem else ''),
|
|
265
280
|
)
|
|
266
281
|
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ips-api-client
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: API client for IPS Controllers pool monitoring system
|
|
5
5
|
Home-page: https://github.com/stgarrity/ips-api-client
|
|
6
6
|
Author: Steve Garrity
|
|
7
|
-
Author-email:
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Homepage, https://github.com/stgarrity/ips-api-client
|
|
10
|
-
Project-URL: Documentation, https://github.com/stgarrity/ips-api-client#readme
|
|
11
|
-
Project-URL: Repository, https://github.com/stgarrity/ips-api-client
|
|
12
|
-
Project-URL: Issues, https://github.com/stgarrity/ips-api-client/issues
|
|
13
|
-
Keywords: ips,pool,chemistry,monitoring,home-assistant
|
|
7
|
+
Author-email: sgarrity@gmail.com
|
|
14
8
|
Classifier: Development Status :: 3 - Alpha
|
|
15
9
|
Classifier: Intended Audience :: Developers
|
|
16
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -19,18 +13,21 @@ Classifier: Programming Language :: Python :: 3
|
|
|
19
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
20
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
-
Classifier: Topic :: Home Automation
|
|
24
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
16
|
Requires-Python: >=3.9
|
|
26
17
|
Description-Content-Type: text/markdown
|
|
27
18
|
License-File: LICENSE
|
|
28
19
|
Requires-Dist: aiohttp>=3.8.0
|
|
29
20
|
Requires-Dist: beautifulsoup4>=4.11.0
|
|
30
21
|
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: description
|
|
25
|
+
Dynamic: description-content-type
|
|
31
26
|
Dynamic: home-page
|
|
32
27
|
Dynamic: license-file
|
|
28
|
+
Dynamic: requires-dist
|
|
33
29
|
Dynamic: requires-python
|
|
30
|
+
Dynamic: summary
|
|
34
31
|
|
|
35
32
|
# IPS Controllers API Client
|
|
36
33
|
|
|
@@ -62,6 +59,7 @@ async def main():
|
|
|
62
59
|
# Get detailed reading
|
|
63
60
|
detail = await client.get_controller_detail(controller.controller_id)
|
|
64
61
|
print(f" pH Setpoint: {detail.ph_setpoint}")
|
|
62
|
+
print(f" ORP Setpoint: {detail.orp_setpoint}")
|
|
65
63
|
print(f" pH State: {detail.ph_state}")
|
|
66
64
|
|
|
67
65
|
asyncio.run(main())
|
|
@@ -84,6 +82,7 @@ asyncio.run(main())
|
|
|
84
82
|
- Controller status
|
|
85
83
|
- Last reading timestamp
|
|
86
84
|
- pH setpoint and state
|
|
85
|
+
- ORP setpoint
|
|
87
86
|
|
|
88
87
|
## License
|
|
89
88
|
|
|
@@ -68,6 +68,7 @@ async def main():
|
|
|
68
68
|
print(f" Temperature: {detail.temperature}")
|
|
69
69
|
print(f" pH State: {detail.ph_state}")
|
|
70
70
|
print(f" pH Setpoint: {detail.ph_setpoint}")
|
|
71
|
+
print(f" ORP Setpoint: {detail.orp_setpoint}")
|
|
71
72
|
print(f" Timestamp: {detail.timestamp}")
|
|
72
73
|
|
|
73
74
|
print("\n" + "=" * 80)
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "ips-api-client"
|
|
7
|
-
version = "0.1.0"
|
|
8
|
-
authors = [
|
|
9
|
-
{name = "Steve Garrity", email = "sgarrity@gmail.com"}
|
|
10
|
-
]
|
|
11
|
-
description = "Async Python client for IPS Controllers pool monitoring system"
|
|
12
|
-
readme = "README.md"
|
|
13
|
-
license = {text = "MIT"}
|
|
14
|
-
requires-python = ">=3.9"
|
|
15
|
-
classifiers = [
|
|
16
|
-
"Development Status :: 3 - Alpha",
|
|
17
|
-
"Intended Audience :: Developers",
|
|
18
|
-
"License :: OSI Approved :: MIT License",
|
|
19
|
-
"Operating System :: OS Independent",
|
|
20
|
-
"Programming Language :: Python :: 3",
|
|
21
|
-
"Programming Language :: Python :: 3.9",
|
|
22
|
-
"Programming Language :: Python :: 3.10",
|
|
23
|
-
"Programming Language :: Python :: 3.11",
|
|
24
|
-
"Programming Language :: Python :: 3.12",
|
|
25
|
-
"Topic :: Home Automation",
|
|
26
|
-
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
27
|
-
]
|
|
28
|
-
keywords = ["ips", "pool", "chemistry", "monitoring", "home-assistant"]
|
|
29
|
-
dependencies = [
|
|
30
|
-
"aiohttp>=3.8.0",
|
|
31
|
-
"beautifulsoup4>=4.11.0",
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
[project.urls]
|
|
35
|
-
Homepage = "https://github.com/stgarrity/ips-api-client"
|
|
36
|
-
Documentation = "https://github.com/stgarrity/ips-api-client#readme"
|
|
37
|
-
Repository = "https://github.com/stgarrity/ips-api-client"
|
|
38
|
-
Issues = "https://github.com/stgarrity/ips-api-client/issues"
|
|
39
|
-
|
|
40
|
-
[tool.setuptools.packages.find]
|
|
41
|
-
include = ["ips_api*"]
|
|
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
|