plugwise 1.4.4__tar.gz → 1.5.0__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.
- {plugwise-1.4.4 → plugwise-1.5.0}/PKG-INFO +1 -1
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/__init__.py +20 -16
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/helper.py +0 -1
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise.egg-info/PKG-INFO +1 -1
- {plugwise-1.4.4 → plugwise-1.5.0}/pyproject.toml +1 -1
- {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_init.py +3 -5
- {plugwise-1.4.4 → plugwise-1.5.0}/LICENSE +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/README.md +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/common.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/constants.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/data.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/exceptions.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/legacy/data.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/legacy/helper.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/legacy/smile.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/py.typed +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/smile.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/util.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise.egg-info/SOURCES.txt +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise.egg-info/dependency_links.txt +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise.egg-info/requires.txt +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/plugwise.egg-info/top_level.txt +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/setup.cfg +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/setup.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_adam.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_anna.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_generic.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_legacy_anna.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_legacy_generic.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_legacy_p1.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_legacy_stretch.py +0 -0
- {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_p1.py +0 -0
@@ -5,7 +5,9 @@ Plugwise backend module for Home Assistant Core.
|
|
5
5
|
from __future__ import annotations
|
6
6
|
|
7
7
|
from plugwise.constants import (
|
8
|
+
DEFAULT_LEGACY_TIMEOUT,
|
8
9
|
DEFAULT_PORT,
|
10
|
+
DEFAULT_TIMEOUT,
|
9
11
|
DEFAULT_USERNAME,
|
10
12
|
DOMAIN_OBJECTS,
|
11
13
|
LOGGER,
|
@@ -43,26 +45,25 @@ class Smile(SmileComm):
|
|
43
45
|
self,
|
44
46
|
host: str,
|
45
47
|
password: str,
|
46
|
-
timeout: int,
|
47
48
|
websession: aiohttp.ClientSession,
|
48
49
|
port: int = DEFAULT_PORT,
|
49
50
|
username: str = DEFAULT_USERNAME,
|
50
51
|
) -> None:
|
51
52
|
"""Set the constructor for this class."""
|
52
|
-
super().__init__(
|
53
|
-
host,
|
54
|
-
password,
|
55
|
-
port,
|
56
|
-
timeout,
|
57
|
-
username,
|
58
|
-
websession,
|
59
|
-
)
|
60
|
-
|
61
53
|
self._host = host
|
62
|
-
self.
|
54
|
+
self._password = password
|
63
55
|
self._port = port
|
64
|
-
self.
|
56
|
+
self._timeout = DEFAULT_LEGACY_TIMEOUT
|
57
|
+
self._username = username
|
65
58
|
self._websession = websession
|
59
|
+
super().__init__(
|
60
|
+
self._host,
|
61
|
+
self._password,
|
62
|
+
self._port,
|
63
|
+
self._timeout,
|
64
|
+
self._username,
|
65
|
+
self._websession,
|
66
|
+
)
|
66
67
|
|
67
68
|
self._cooling_present = False
|
68
69
|
self._elga = False
|
@@ -126,7 +127,7 @@ class Smile(SmileComm):
|
|
126
127
|
|
127
128
|
self._smile_api = SmileAPI(
|
128
129
|
self._host,
|
129
|
-
self.
|
130
|
+
self._password,
|
130
131
|
self._request,
|
131
132
|
self._websession,
|
132
133
|
self._cooling_present,
|
@@ -147,10 +148,10 @@ class Smile(SmileComm):
|
|
147
148
|
self.smile_name,
|
148
149
|
self.smile_type,
|
149
150
|
self._port,
|
150
|
-
self.
|
151
|
+
self._username,
|
151
152
|
) if not self.smile_legacy else SmileLegacyAPI(
|
152
153
|
self._host,
|
153
|
-
self.
|
154
|
+
self._password,
|
154
155
|
self._request,
|
155
156
|
self._websession,
|
156
157
|
self._is_thermostat,
|
@@ -168,7 +169,7 @@ class Smile(SmileComm):
|
|
168
169
|
self.smile_type,
|
169
170
|
self.smile_zigbee_mac_address,
|
170
171
|
self._port,
|
171
|
-
self.
|
172
|
+
self._username,
|
172
173
|
)
|
173
174
|
|
174
175
|
# Update all endpoints on first connect
|
@@ -212,6 +213,9 @@ class Smile(SmileComm):
|
|
212
213
|
)
|
213
214
|
raise UnsupportedDeviceError
|
214
215
|
|
216
|
+
if not self.smile_legacy:
|
217
|
+
self._timeout = DEFAULT_TIMEOUT
|
218
|
+
|
215
219
|
if self._target_smile in ("smile_open_therm_v2", "smile_thermo_v3"):
|
216
220
|
LOGGER.error(
|
217
221
|
"Your Smile identified as %s needs a firmware update as it's firmware is severely outdated",
|
@@ -323,7 +323,6 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
|
|
323
323
|
username=pw_constants.DEFAULT_USERNAME,
|
324
324
|
password=test_password,
|
325
325
|
port=server.port,
|
326
|
-
timeout=pw_constants.DEFAULT_TIMEOUT,
|
327
326
|
websession=None,
|
328
327
|
)
|
329
328
|
lack_of_websession = False
|
@@ -337,18 +336,18 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
|
|
337
336
|
username=pw_constants.DEFAULT_USERNAME,
|
338
337
|
password=test_password,
|
339
338
|
port=server.port,
|
340
|
-
timeout=pw_constants.DEFAULT_TIMEOUT,
|
341
339
|
websession=websession,
|
342
340
|
)
|
343
341
|
|
344
342
|
if not timeout:
|
345
|
-
assert smile._timeout ==
|
343
|
+
assert smile._timeout == 30
|
346
344
|
|
347
345
|
# Connect to the smile
|
348
346
|
version = None
|
349
347
|
try:
|
350
348
|
version = await smile.connect()
|
351
349
|
assert version is not None
|
350
|
+
assert smile._timeout == 10
|
352
351
|
return server, smile, client
|
353
352
|
except (
|
354
353
|
pw_exceptions.ConnectionFailedError,
|
@@ -408,7 +407,6 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
|
|
408
407
|
username=pw_constants.DEFAULT_USERNAME,
|
409
408
|
password=test_password,
|
410
409
|
port=server.port,
|
411
|
-
timeout=pw_constants.DEFAULT_LEGACY_TIMEOUT,
|
412
410
|
websession=None,
|
413
411
|
)
|
414
412
|
lack_of_websession = False
|
@@ -422,7 +420,6 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
|
|
422
420
|
username=pw_constants.DEFAULT_USERNAME,
|
423
421
|
password=test_password,
|
424
422
|
port=server.port,
|
425
|
-
timeout=pw_constants.DEFAULT_LEGACY_TIMEOUT,
|
426
423
|
websession=websession,
|
427
424
|
)
|
428
425
|
|
@@ -434,6 +431,7 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
|
|
434
431
|
try:
|
435
432
|
version = await smile.connect()
|
436
433
|
assert version is not None
|
434
|
+
assert smile._timeout == 30
|
437
435
|
return server, smile, client
|
438
436
|
except (
|
439
437
|
pw_exceptions.ConnectionFailedError,
|
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
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|