python-hotspring 3.0.0__tar.gz → 3.0.2__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.
- {python_hotspring-3.0.0 → python_hotspring-3.0.2}/PKG-INFO +2 -1
- {python_hotspring-3.0.0 → python_hotspring-3.0.2}/pyproject.toml +1 -1
- {python_hotspring-3.0.0 → python_hotspring-3.0.2}/src/hotspring/hotspring.py +4 -4
- {python_hotspring-3.0.0 → python_hotspring-3.0.2}/src/hotspring/models.py +30 -7
- {python_hotspring-3.0.0 → python_hotspring-3.0.2}/LICENSE +0 -0
- {python_hotspring-3.0.0 → python_hotspring-3.0.2}/README.md +0 -0
- {python_hotspring-3.0.0 → python_hotspring-3.0.2}/src/hotspring/__init__.py +0 -0
- {python_hotspring-3.0.0 → python_hotspring-3.0.2}/src/hotspring/const.py +0 -0
- {python_hotspring-3.0.0 → python_hotspring-3.0.2}/src/hotspring/exceptions.py +0 -0
- {python_hotspring-3.0.0 → python_hotspring-3.0.2}/src/hotspring/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-hotspring
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.2
|
|
4
4
|
Summary: Asynchronous Python client for Hot Spring Connected Spa Kit 2.
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -19,6 +19,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
22
23
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
24
|
Requires-Dist: aiohttp (>=3.0.0)
|
|
24
25
|
Requires-Dist: awesomeversion (>=22.1.0)
|
|
@@ -23,7 +23,7 @@ packages = [
|
|
|
23
23
|
readme = "README.md"
|
|
24
24
|
repository = "https://github.com/Moustachauve/python-hotspring"
|
|
25
25
|
# The CI/CD and GitHub Actions release workflows are responsible for setting the version tag
|
|
26
|
-
version = "3.0.
|
|
26
|
+
version = "3.0.2"
|
|
27
27
|
|
|
28
28
|
[tool.poetry.dependencies]
|
|
29
29
|
aiohttp = ">=3.0.0"
|
|
@@ -224,7 +224,7 @@ class HotSpring: # pylint: disable=too-many-public-methods
|
|
|
224
224
|
):
|
|
225
225
|
self.spa.connection_status.spa_connected = True
|
|
226
226
|
|
|
227
|
-
if self.validate_device and self.spa.
|
|
227
|
+
if self.validate_device and self.spa.is_sna:
|
|
228
228
|
msg = (
|
|
229
229
|
f"Connected to Spa Network Adapter (SNA) with hostname "
|
|
230
230
|
f"'{self.spa.info.hostname}'. The Home Network Adapter (HNA) "
|
|
@@ -303,7 +303,7 @@ class HotSpring: # pylint: disable=too-many-public-methods
|
|
|
303
303
|
if identity_data:
|
|
304
304
|
self.spa.update_info(identity_data)
|
|
305
305
|
|
|
306
|
-
if self.validate_device and self.spa.
|
|
306
|
+
if self.validate_device and self.spa.is_sna:
|
|
307
307
|
msg = (
|
|
308
308
|
f"Connected to Spa Network Adapter (SNA) with hostname "
|
|
309
309
|
f"'{self.spa.info.hostname}'. The Home Network Adapter (HNA) "
|
|
@@ -422,13 +422,13 @@ class HotSpring: # pylint: disable=too-many-public-methods
|
|
|
422
422
|
msg = f"Command failed: {payload}"
|
|
423
423
|
raise HotSpringCommandError(msg) from exception
|
|
424
424
|
|
|
425
|
-
async def set_temperature(self, temperature:
|
|
425
|
+
async def set_temperature(self, temperature: float) -> None:
|
|
426
426
|
"""Set the target water temperature.
|
|
427
427
|
|
|
428
428
|
Args:
|
|
429
429
|
----
|
|
430
430
|
temperature: Target temperature in the spa's configured unit
|
|
431
|
-
(Fahrenheit or Celsius).
|
|
431
|
+
(Fahrenheit or Celsius). Supports integer or half-degree float values.
|
|
432
432
|
|
|
433
433
|
"""
|
|
434
434
|
await self._send_command(
|
|
@@ -213,6 +213,26 @@ class Spa:
|
|
|
213
213
|
"""
|
|
214
214
|
self.freshwater_iq = FreshWaterIQ.from_dict(data)
|
|
215
215
|
|
|
216
|
+
@property
|
|
217
|
+
def is_hna(self) -> bool:
|
|
218
|
+
"""Return True if this device is the Home Network Adapter (HNA)."""
|
|
219
|
+
if self.info.is_sna:
|
|
220
|
+
return False
|
|
221
|
+
|
|
222
|
+
if self.info.sna_ready:
|
|
223
|
+
return True
|
|
224
|
+
|
|
225
|
+
return (
|
|
226
|
+
self.heater.current_temperature is not None
|
|
227
|
+
or self.heater.set_temperature is not None
|
|
228
|
+
or bool(getattr(self.versions, "control_box", ""))
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
@property
|
|
232
|
+
def is_sna(self) -> bool:
|
|
233
|
+
"""Return True if this device is the Spa Network Adapter (SNA)."""
|
|
234
|
+
return not self.is_hna
|
|
235
|
+
|
|
216
236
|
|
|
217
237
|
@dataclass
|
|
218
238
|
class SpaInfo:
|
|
@@ -317,22 +337,25 @@ class SpaInfo:
|
|
|
317
337
|
The HNA (Home Network Adapter) is the intended API bridge.
|
|
318
338
|
The SNA (Spa Network Adapter) is the tub-side module.
|
|
319
339
|
|
|
320
|
-
On the HNA
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
340
|
+
On the HNA with an active link to the SNA, 'SNAready' is 'Yes' (True).
|
|
341
|
+
The SNA firmware always reports 'SNAready' as 'No' (False).
|
|
342
|
+
|
|
343
|
+
When 'root_topic' does not match the hostname MAC suffix and 'sna_ready'
|
|
344
|
+
is False, this indicates an SNA on setups where HNA MAC > SNA MAC.
|
|
325
345
|
|
|
326
346
|
Returns
|
|
327
347
|
-------
|
|
328
|
-
DeviceType.HNA if hostname matches root_topic,
|
|
329
|
-
DeviceType.SNA if hostname differs from root_topic,
|
|
348
|
+
DeviceType.HNA if sna_ready is True or hostname matches root_topic,
|
|
349
|
+
DeviceType.SNA if hostname differs from root_topic and sna_ready is False,
|
|
330
350
|
DeviceType.UNKNOWN if information is missing.
|
|
331
351
|
|
|
332
352
|
"""
|
|
333
353
|
if not self.hostname or not self.root_topic:
|
|
334
354
|
return DeviceType.UNKNOWN
|
|
335
355
|
|
|
356
|
+
if self.sna_ready:
|
|
357
|
+
return DeviceType.HNA
|
|
358
|
+
|
|
336
359
|
mac_suffix = self.hostname.rsplit("_", 1)[-1]
|
|
337
360
|
if self.root_topic.lower().endswith(mac_suffix.lower()):
|
|
338
361
|
return DeviceType.HNA
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|