plugwise 1.4.3__py3-none-any.whl → 1.4.4__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.
- plugwise/__init__.py +9 -8
- plugwise/helper.py +3 -2
- plugwise/legacy/helper.py +3 -2
- plugwise/legacy/smile.py +2 -1
- plugwise/smile.py +2 -1
- {plugwise-1.4.3.dist-info → plugwise-1.4.4.dist-info}/METADATA +1 -1
- plugwise-1.4.4.dist-info/RECORD +17 -0
- plugwise-1.4.3.dist-info/RECORD +0 -17
- {plugwise-1.4.3.dist-info → plugwise-1.4.4.dist-info}/LICENSE +0 -0
- {plugwise-1.4.3.dist-info → plugwise-1.4.4.dist-info}/WHEEL +0 -0
- {plugwise-1.4.3.dist-info → plugwise-1.4.4.dist-info}/top_level.txt +0 -0
plugwise/__init__.py
CHANGED
@@ -31,6 +31,7 @@ from plugwise.smile import SmileAPI
|
|
31
31
|
|
32
32
|
import aiohttp
|
33
33
|
from defusedxml import ElementTree as etree
|
34
|
+
from packaging.version import Version, parse
|
34
35
|
|
35
36
|
|
36
37
|
class Smile(SmileComm):
|
@@ -75,7 +76,7 @@ class Smile(SmileComm):
|
|
75
76
|
self._target_smile: str = NONE
|
76
77
|
self.gateway_id: str = NONE
|
77
78
|
self.loc_data: dict[str, ThermoLoc] = {}
|
78
|
-
self.smile_fw_version:
|
79
|
+
self.smile_fw_version: Version | None = None
|
79
80
|
self.smile_hostname: str = NONE
|
80
81
|
self.smile_hw_version: str | None = None
|
81
82
|
self.smile_legacy = False
|
@@ -84,10 +85,10 @@ class Smile(SmileComm):
|
|
84
85
|
self.smile_model_id: str | None = None
|
85
86
|
self.smile_name: str = NONE
|
86
87
|
self.smile_type: str = NONE
|
87
|
-
self.smile_version:
|
88
|
+
self.smile_version: Version | None = None
|
88
89
|
self.smile_zigbee_mac_address: str | None = None
|
89
90
|
|
90
|
-
async def connect(self) ->
|
91
|
+
async def connect(self) -> Version | None:
|
91
92
|
"""Connect to Plugwise device and determine its name, type and version."""
|
92
93
|
result = await self._request(DOMAIN_OBJECTS)
|
93
94
|
# Work-around for Stretch fw 2.7.18
|
@@ -173,7 +174,7 @@ class Smile(SmileComm):
|
|
173
174
|
# Update all endpoints on first connect
|
174
175
|
await self._smile_api.full_update_device()
|
175
176
|
|
176
|
-
return
|
177
|
+
return self.smile_version
|
177
178
|
|
178
179
|
async def _smile_detect(self, result: etree, dsmrmain: etree) -> None:
|
179
180
|
"""Helper-function for connect().
|
@@ -184,7 +185,7 @@ class Smile(SmileComm):
|
|
184
185
|
if (gateway := result.find("./gateway")) is not None:
|
185
186
|
if (v_model := gateway.find("vendor_model")) is not None:
|
186
187
|
model = v_model.text
|
187
|
-
self.smile_fw_version = gateway.find("firmware_version").text
|
188
|
+
self.smile_fw_version = parse(gateway.find("firmware_version").text)
|
188
189
|
self.smile_hw_version = gateway.find("hardware_version").text
|
189
190
|
self.smile_hostname = gateway.find("hostname").text
|
190
191
|
self.smile_mac_address = gateway.find("mac_address").text
|
@@ -200,7 +201,7 @@ class Smile(SmileComm):
|
|
200
201
|
)
|
201
202
|
raise UnsupportedDeviceError
|
202
203
|
|
203
|
-
version_major
|
204
|
+
version_major= str(self.smile_fw_version.major)
|
204
205
|
self._target_smile = f"{model}_v{version_major}"
|
205
206
|
LOGGER.debug("Plugwise identified as %s", self._target_smile)
|
206
207
|
if self._target_smile not in SMILES:
|
@@ -267,7 +268,7 @@ class Smile(SmileComm):
|
|
267
268
|
or network is not None
|
268
269
|
):
|
269
270
|
system = await self._request(SYSTEM)
|
270
|
-
self.smile_fw_version = system.find("./gateway/firmware").text
|
271
|
+
self.smile_fw_version = parse(system.find("./gateway/firmware").text)
|
271
272
|
return_model = system.find("./gateway/product").text
|
272
273
|
self.smile_hostname = system.find("./gateway/hostname").text
|
273
274
|
# If wlan0 contains data it's active, so eth0 should be checked last
|
@@ -278,7 +279,7 @@ class Smile(SmileComm):
|
|
278
279
|
# P1 legacy:
|
279
280
|
elif dsmrmain is not None:
|
280
281
|
status = await self._request(STATUS)
|
281
|
-
self.smile_fw_version = status.find("./system/version").text
|
282
|
+
self.smile_fw_version = parse(status.find("./system/version").text)
|
282
283
|
return_model = status.find("./system/product").text
|
283
284
|
self.smile_hostname = status.find("./network/hostname").text
|
284
285
|
self.smile_mac_address = status.find("./network/mac_address").text
|
plugwise/helper.py
CHANGED
@@ -62,6 +62,7 @@ from dateutil import tz
|
|
62
62
|
from dateutil.parser import parse
|
63
63
|
from defusedxml import ElementTree as etree
|
64
64
|
from munch import Munch
|
65
|
+
from packaging.version import Version
|
65
66
|
|
66
67
|
|
67
68
|
class SmileComm:
|
@@ -250,7 +251,7 @@ class SmileHelper(SmileCommon):
|
|
250
251
|
self.gw_data: GatewayData = {}
|
251
252
|
self.gw_devices: dict[str, DeviceData] = {}
|
252
253
|
self.loc_data: dict[str, ThermoLoc]
|
253
|
-
self.smile_fw_version:
|
254
|
+
self.smile_fw_version: Version | None
|
254
255
|
self.smile_hw_version: str | None
|
255
256
|
self.smile_mac_address: str | None
|
256
257
|
self.smile_model: str
|
@@ -425,7 +426,7 @@ class SmileHelper(SmileCommon):
|
|
425
426
|
def _appl_gateway_info(self, appl: Munch, appliance: etree) -> Munch:
|
426
427
|
"""Helper-function for _appliance_info_finder()."""
|
427
428
|
self.gateway_id = appliance.attrib["id"]
|
428
|
-
appl.firmware = self.smile_fw_version
|
429
|
+
appl.firmware = str(self.smile_fw_version)
|
429
430
|
appl.hardware = self.smile_hw_version
|
430
431
|
appl.mac = self.smile_mac_address
|
431
432
|
appl.model = self.smile_model
|
plugwise/legacy/helper.py
CHANGED
@@ -44,6 +44,7 @@ from plugwise.util import (
|
|
44
44
|
# This way of importing aiohttp is because of patch/mocking in testing (aiohttp timeouts)
|
45
45
|
from defusedxml import ElementTree as etree
|
46
46
|
from munch import Munch
|
47
|
+
from packaging.version import Version
|
47
48
|
|
48
49
|
|
49
50
|
def etree_to_dict(element: etree) -> dict[str, str]:
|
@@ -81,7 +82,7 @@ class SmileLegacyHelper(SmileCommon):
|
|
81
82
|
self.gw_data: GatewayData = {}
|
82
83
|
self.gw_devices: dict[str, DeviceData] = {}
|
83
84
|
self.loc_data: dict[str, ThermoLoc]
|
84
|
-
self.smile_fw_version:
|
85
|
+
self.smile_fw_version: Version | None
|
85
86
|
self.smile_hw_version: str | None
|
86
87
|
self.smile_mac_address: str | None
|
87
88
|
self.smile_model: str
|
@@ -194,7 +195,7 @@ class SmileLegacyHelper(SmileCommon):
|
|
194
195
|
self.gw_devices[self.gateway_id] = {"dev_class": "gateway"}
|
195
196
|
self._count += 1
|
196
197
|
for key, value in {
|
197
|
-
"firmware": self.smile_fw_version,
|
198
|
+
"firmware": str(self.smile_fw_version),
|
198
199
|
"location": self._home_location,
|
199
200
|
"mac_address": self.smile_mac_address,
|
200
201
|
"model": self.smile_model,
|
plugwise/legacy/smile.py
CHANGED
@@ -29,6 +29,7 @@ from plugwise.legacy.data import SmileLegacyData
|
|
29
29
|
|
30
30
|
import aiohttp
|
31
31
|
from munch import Munch
|
32
|
+
from packaging.version import Version
|
32
33
|
|
33
34
|
|
34
35
|
class SmileLegacyAPI(SmileLegacyData):
|
@@ -48,7 +49,7 @@ class SmileLegacyAPI(SmileLegacyData):
|
|
48
49
|
_stretch_v2: bool,
|
49
50
|
_target_smile: str,
|
50
51
|
loc_data: dict[str, ThermoLoc],
|
51
|
-
smile_fw_version:
|
52
|
+
smile_fw_version: Version | None,
|
52
53
|
smile_hostname: str,
|
53
54
|
smile_hw_version: str | None,
|
54
55
|
smile_mac_address: str | None,
|
plugwise/smile.py
CHANGED
@@ -35,6 +35,7 @@ from defusedxml import ElementTree as etree
|
|
35
35
|
|
36
36
|
# Dict as class
|
37
37
|
from munch import Munch
|
38
|
+
from packaging.version import Version
|
38
39
|
|
39
40
|
|
40
41
|
class SmileAPI(SmileData):
|
@@ -57,7 +58,7 @@ class SmileAPI(SmileData):
|
|
57
58
|
_schedule_old_states: dict[str, dict[str, str]],
|
58
59
|
gateway_id: str,
|
59
60
|
loc_data: dict[str, ThermoLoc],
|
60
|
-
smile_fw_version:
|
61
|
+
smile_fw_version: Version | None,
|
61
62
|
smile_hostname: str | None,
|
62
63
|
smile_hw_version: str | None,
|
63
64
|
smile_mac_address: str | None,
|
@@ -0,0 +1,17 @@
|
|
1
|
+
plugwise/__init__.py,sha256=7Ssc6A4eiJwfk2jOZkSuO5OwqWEk_XOHIXQIv3TAIh8,16941
|
2
|
+
plugwise/common.py,sha256=WltDqYlW5D3KqIcm5U_gVY4izLZSk_Uk-MEJl6RDNbs,12592
|
3
|
+
plugwise/constants.py,sha256=kVNrr4zeKFMiGBogVLZ6B925FHAIgy1PY2BBxaT1vkk,16742
|
4
|
+
plugwise/data.py,sha256=I4w3ABqmcj_uSnfxTWPYQH8WP6HaywVMx1aQ-feBdU0,10734
|
5
|
+
plugwise/exceptions.py,sha256=Ce-tO9uNsMB-8FP6VAxBvsHNJ-NIM9F0onUZOdZI4Ys,1110
|
6
|
+
plugwise/helper.py,sha256=zxKxt5qyvUkbVbXOxut1nyqn7r5QxdbzOvwY6tu7eVA,44465
|
7
|
+
plugwise/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
+
plugwise/smile.py,sha256=BALKDMY730C-vHCnOadnaM9ezv0iIEnu-V-BsHJRewY,18729
|
9
|
+
plugwise/util.py,sha256=u2qQt6ubQW1ioiDIIzOMnyydxQH5_48_Tbw_vEgCpyg,8161
|
10
|
+
plugwise/legacy/data.py,sha256=DsHR9xgiFDg_Vh_6ZpOskw8ZhNQ3CmwjstI3yiH6MEk,3048
|
11
|
+
plugwise/legacy/helper.py,sha256=HI9EvtTWfzKH5nX4G-YtLpn9Qvi50OLMRRIaN5v7rqU,18358
|
12
|
+
plugwise/legacy/smile.py,sha256=E_Zc1muzylyRMeYYbP4QhGBUQf_KaUUnbPAuIhH8WxY,11208
|
13
|
+
plugwise-1.4.4.dist-info/LICENSE,sha256=mL22BjmXtg_wnoDnnaqps5_Bg_VGj_yHueX5lsKwbCc,1144
|
14
|
+
plugwise-1.4.4.dist-info/METADATA,sha256=TOkZAEFXiCs4a4UP17KcOYnE5nhj9oXNSJDELndAV28,9097
|
15
|
+
plugwise-1.4.4.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
16
|
+
plugwise-1.4.4.dist-info/top_level.txt,sha256=MYOmktMFf8ZmX6_OE1y9MoCZFfY-L8DA0F2tA2IvE4s,9
|
17
|
+
plugwise-1.4.4.dist-info/RECORD,,
|
plugwise-1.4.3.dist-info/RECORD
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
plugwise/__init__.py,sha256=tv6B4s9TQAsmKhqiXpyGuszjfcP7wNRx_EFoorBevwA,16848
|
2
|
-
plugwise/common.py,sha256=WltDqYlW5D3KqIcm5U_gVY4izLZSk_Uk-MEJl6RDNbs,12592
|
3
|
-
plugwise/constants.py,sha256=kVNrr4zeKFMiGBogVLZ6B925FHAIgy1PY2BBxaT1vkk,16742
|
4
|
-
plugwise/data.py,sha256=I4w3ABqmcj_uSnfxTWPYQH8WP6HaywVMx1aQ-feBdU0,10734
|
5
|
-
plugwise/exceptions.py,sha256=Ce-tO9uNsMB-8FP6VAxBvsHNJ-NIM9F0onUZOdZI4Ys,1110
|
6
|
-
plugwise/helper.py,sha256=uOmxYr4ic1F8nYLHb1c1dC7-WphM82VT9vMLQet3CU8,44418
|
7
|
-
plugwise/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
plugwise/smile.py,sha256=x0BrEUMcW0oBAwgdr0qUvesoGvlHojgV96OxD2HdXd0,18687
|
9
|
-
plugwise/util.py,sha256=u2qQt6ubQW1ioiDIIzOMnyydxQH5_48_Tbw_vEgCpyg,8161
|
10
|
-
plugwise/legacy/data.py,sha256=DsHR9xgiFDg_Vh_6ZpOskw8ZhNQ3CmwjstI3yiH6MEk,3048
|
11
|
-
plugwise/legacy/helper.py,sha256=DjdyU5kwXg4N5ZU9H65w7MSUY6SADcaAy_OziyFKDis,18311
|
12
|
-
plugwise/legacy/smile.py,sha256=Rg4MX5hbCddrG03BWiCxzRWmAq4-_31Li45T6w79z8U,11166
|
13
|
-
plugwise-1.4.3.dist-info/LICENSE,sha256=mL22BjmXtg_wnoDnnaqps5_Bg_VGj_yHueX5lsKwbCc,1144
|
14
|
-
plugwise-1.4.3.dist-info/METADATA,sha256=hznYuWl93GPYl2H5UQcFv-fGquL7YnAd3l0LwxqflGw,9097
|
15
|
-
plugwise-1.4.3.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
16
|
-
plugwise-1.4.3.dist-info/top_level.txt,sha256=MYOmktMFf8ZmX6_OE1y9MoCZFfY-L8DA0F2tA2IvE4s,9
|
17
|
-
plugwise-1.4.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|