python-hotspring 3.0.2__py3-none-any.whl → 3.1.0__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 +14 -40
- {python_hotspring-3.0.2.dist-info → python_hotspring-3.1.0.dist-info}/METADATA +1 -1
- python_hotspring-3.1.0.dist-info/RECORD +10 -0
- python_hotspring-3.0.2.dist-info/RECORD +0 -10
- {python_hotspring-3.0.2.dist-info → python_hotspring-3.1.0.dist-info}/WHEEL +0 -0
- {python_hotspring-3.0.2.dist-info → python_hotspring-3.1.0.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 not self.spa.is_hna:
|
|
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 not self.spa.is_hna:
|
|
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
|
@@ -216,22 +216,14 @@ class Spa:
|
|
|
216
216
|
@property
|
|
217
217
|
def is_hna(self) -> bool:
|
|
218
218
|
"""Return True if this device is the Home Network Adapter (HNA)."""
|
|
219
|
-
|
|
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
|
-
)
|
|
219
|
+
return self.info.sna_ready or bool(getattr(self.versions, "control_box", ""))
|
|
230
220
|
|
|
231
221
|
@property
|
|
232
|
-
def
|
|
233
|
-
"""
|
|
234
|
-
|
|
222
|
+
def device_type(self) -> DeviceType:
|
|
223
|
+
"""Determine whether the device is an HNA or SNA."""
|
|
224
|
+
if not self.info.hostname:
|
|
225
|
+
return DeviceType.UNKNOWN
|
|
226
|
+
return DeviceType.HNA if self.is_hna else DeviceType.SNA
|
|
235
227
|
|
|
236
228
|
|
|
237
229
|
@dataclass
|
|
@@ -334,42 +326,24 @@ class SpaInfo:
|
|
|
334
326
|
def device_type(self) -> DeviceType:
|
|
335
327
|
"""Determine whether the device is an HNA or SNA.
|
|
336
328
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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.
|
|
329
|
+
Only the HNA can report 'SNAready' as 'Yes'; the SNA firmware always
|
|
330
|
+
reports 'No'. The hostname/rootTopic MAC suffixes cannot be used,
|
|
331
|
+
since rootTopic is built from the higher of the two adapter MACs.
|
|
345
332
|
|
|
346
333
|
Returns
|
|
347
334
|
-------
|
|
348
|
-
DeviceType.
|
|
349
|
-
DeviceType.
|
|
350
|
-
DeviceType.UNKNOWN if information is missing.
|
|
335
|
+
DeviceType.UNKNOWN if /startup data is missing,
|
|
336
|
+
DeviceType.HNA if sna_ready is True, otherwise DeviceType.SNA.
|
|
351
337
|
|
|
352
338
|
"""
|
|
353
|
-
if not self.hostname
|
|
339
|
+
if not self.hostname:
|
|
354
340
|
return DeviceType.UNKNOWN
|
|
355
|
-
|
|
356
|
-
if self.sna_ready:
|
|
357
|
-
return DeviceType.HNA
|
|
358
|
-
|
|
359
|
-
mac_suffix = self.hostname.rsplit("_", 1)[-1]
|
|
360
|
-
if self.root_topic.lower().endswith(mac_suffix.lower()):
|
|
361
|
-
return DeviceType.HNA
|
|
362
|
-
return DeviceType.SNA
|
|
341
|
+
return DeviceType.HNA if self.sna_ready else DeviceType.SNA
|
|
363
342
|
|
|
364
343
|
@property
|
|
365
344
|
def is_hna(self) -> bool:
|
|
366
345
|
"""Return True if this device is the Home Network Adapter (HNA)."""
|
|
367
|
-
return self.
|
|
368
|
-
|
|
369
|
-
@property
|
|
370
|
-
def is_sna(self) -> bool:
|
|
371
|
-
"""Return True if this device is the Spa Network Adapter (SNA)."""
|
|
372
|
-
return self.device_type == DeviceType.SNA
|
|
346
|
+
return self.sna_ready
|
|
373
347
|
|
|
374
348
|
|
|
375
349
|
@dataclass
|
|
@@ -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=uQHNk5hTxHGRIxmiWzn-eGv7DVd0wiGrLouXahIIqaE,28896
|
|
5
|
+
hotspring/models.py,sha256=uiN7_VkHHLmKEagbRDBAa5xvYFLfZ98U_H93K-pkNd0,53465
|
|
6
|
+
hotspring/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
python_hotspring-3.1.0.dist-info/METADATA,sha256=lq6FH-ct7qVgisgJ24M0mLvVkI6GyyIaQwWKngNq5s8,8118
|
|
8
|
+
python_hotspring-3.1.0.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
|
|
9
|
+
python_hotspring-3.1.0.dist-info/licenses/LICENSE,sha256=4n3vNP1aJ5r8xLfzCCjo5l0EK5-k2-7w9rgucn7WVFM,1080
|
|
10
|
+
python_hotspring-3.1.0.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=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,,
|
|
File without changes
|
|
File without changes
|