python-hotspring 3.0.1__py3-none-any.whl → 3.0.2__py3-none-any.whl
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.
- hotspring/hotspring.py +2 -2
- hotspring/models.py +30 -7
- {python_hotspring-3.0.1.dist-info → python_hotspring-3.0.2.dist-info}/METADATA +1 -1
- python_hotspring-3.0.2.dist-info/RECORD +10 -0
- python_hotspring-3.0.1.dist-info/RECORD +0 -10
- {python_hotspring-3.0.1.dist-info → python_hotspring-3.0.2.dist-info}/WHEEL +0 -0
- {python_hotspring-3.0.1.dist-info → python_hotspring-3.0.2.dist-info}/licenses/LICENSE +0 -0
hotspring/hotspring.py
CHANGED
|
@@ -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) "
|
hotspring/models.py
CHANGED
|
@@ -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
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
hotspring/__init__.py,sha256=wV3giZmeCl0qdz6zStvbQAYOBc6d5qdAFzEaHViYKkA,1560
|
|
2
|
+
hotspring/const.py,sha256=ggMcA7ng0pdfquOAQdM7gUoF48J7ha5diya-YkYqFaA,14490
|
|
3
|
+
hotspring/exceptions.py,sha256=R8YwGfi6mXZ5DcHw4_fmtrRuvgkfOrLRCH-d3x6OUIw,1184
|
|
4
|
+
hotspring/hotspring.py,sha256=ME8TDpsF9JCHYxhFbMjRP8b90G1nM3gR7WTIPWOIkhg,28888
|
|
5
|
+
hotspring/models.py,sha256=yP09VLMwCKP2wk8xEuGpWwVeTeEtEkucCe8NhKDIzTs,54278
|
|
6
|
+
hotspring/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
python_hotspring-3.0.2.dist-info/METADATA,sha256=EePlcpJ_wIfMrNKwQFK5_LsAYckvybUJLgLxQ0qs6VY,8118
|
|
8
|
+
python_hotspring-3.0.2.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
|
|
9
|
+
python_hotspring-3.0.2.dist-info/licenses/LICENSE,sha256=4n3vNP1aJ5r8xLfzCCjo5l0EK5-k2-7w9rgucn7WVFM,1080
|
|
10
|
+
python_hotspring-3.0.2.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
hotspring/__init__.py,sha256=wV3giZmeCl0qdz6zStvbQAYOBc6d5qdAFzEaHViYKkA,1560
|
|
2
|
-
hotspring/const.py,sha256=ggMcA7ng0pdfquOAQdM7gUoF48J7ha5diya-YkYqFaA,14490
|
|
3
|
-
hotspring/exceptions.py,sha256=R8YwGfi6mXZ5DcHw4_fmtrRuvgkfOrLRCH-d3x6OUIw,1184
|
|
4
|
-
hotspring/hotspring.py,sha256=sMuYgPZr_IOiF2K1oju6MkGDWiVSl-hsuaFBV_uqBIg,28898
|
|
5
|
-
hotspring/models.py,sha256=S45nzQ37k8CTNEvJ5IZXylezbhmRBiLpRg9SVHltvFE,53598
|
|
6
|
-
hotspring/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
python_hotspring-3.0.1.dist-info/METADATA,sha256=lNpZ6C2qjIRhnGxikU_tnivC7JdqmCHc0NIjP3B_m_I,8118
|
|
8
|
-
python_hotspring-3.0.1.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
|
|
9
|
-
python_hotspring-3.0.1.dist-info/licenses/LICENSE,sha256=4n3vNP1aJ5r8xLfzCCjo5l0EK5-k2-7w9rgucn7WVFM,1080
|
|
10
|
-
python_hotspring-3.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|