plugwise 1.4.1__py3-none-any.whl → 1.4.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.
plugwise/__init__.py CHANGED
@@ -5,7 +5,6 @@ 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,
9
8
  DEFAULT_PORT,
10
9
  DEFAULT_TIMEOUT,
11
10
  DEFAULT_USERNAME,
@@ -44,28 +43,27 @@ class Smile(SmileComm):
44
43
  self,
45
44
  host: str,
46
45
  password: str,
46
+ timeout: int,
47
47
  websession: aiohttp.ClientSession,
48
- username: str = DEFAULT_USERNAME,
49
48
  port: int = DEFAULT_PORT,
50
- timeout: float = DEFAULT_LEGACY_TIMEOUT,
51
-
49
+ username: str = DEFAULT_USERNAME,
52
50
  ) -> None:
53
51
  """Set the constructor for this class."""
54
52
  super().__init__(
55
53
  host,
56
54
  password,
57
- websession,
58
- username,
59
55
  port,
60
56
  timeout,
61
- )
57
+ username,
58
+ websession,
59
+ )
62
60
 
63
61
  self._host = host
64
62
  self._passwd = password
65
- self._websession = websession
66
- self._user = username
67
63
  self._port = port
68
64
  self._timeout = timeout
65
+ self._user = username
66
+ self._websession = websession
69
67
 
70
68
  self._cooling_present = False
71
69
  self._elga = False
@@ -149,8 +147,8 @@ class Smile(SmileComm):
149
147
  self.smile_model_id,
150
148
  self.smile_name,
151
149
  self.smile_type,
152
- self._user,
153
150
  self._port,
151
+ self._user,
154
152
  ) if not self.smile_legacy else SmileLegacyAPI(
155
153
  self._host,
156
154
  self._passwd,
@@ -170,8 +168,8 @@ class Smile(SmileComm):
170
168
  self.smile_name,
171
169
  self.smile_type,
172
170
  self.smile_zigbee_mac_address,
173
- self._user,
174
171
  self._port,
172
+ self._user,
175
173
  )
176
174
 
177
175
  # Update all endpoints on first connect
plugwise/common.py CHANGED
@@ -57,10 +57,6 @@ class SmileCommon:
57
57
  xml_3: etree = None,
58
58
  ) -> Munch:
59
59
  """Helper-function for _appliance_info_finder()."""
60
- # Remove heater_central when no active device present
61
- if not self._opentherm_device and not self._on_off_device:
62
- return None
63
-
64
60
  # Find the valid heater_central
65
61
  # xml_2 self._appliances for legacy, self._domain_objects for actual
66
62
  xml_2 = return_valid(xml_2, self._domain_objects)
plugwise/helper.py CHANGED
@@ -71,10 +71,10 @@ class SmileComm:
71
71
  self,
72
72
  host: str,
73
73
  password: str,
74
- websession: ClientSession | None,
75
- username: str,
76
74
  port: int,
77
- timeout: float,
75
+ timeout: int,
76
+ username: str,
77
+ websession: ClientSession | None,
78
78
  ) -> None:
79
79
  """Set the constructor for this class."""
80
80
  if not websession:
@@ -269,6 +269,13 @@ class SmileHelper(SmileCommon):
269
269
  for appliance in self._domain_objects.findall("./appliance"):
270
270
  appl = Munch()
271
271
  appl.pwclass = appliance.find("type").text
272
+ # Extend device_class name of Plugs (Plugwise and Aqara) - Pw-Beta Issue #739
273
+ description = appliance.find("description").text
274
+ if description is not None and (
275
+ "ZigBee protocol" in description or "smart plug" in description
276
+ ):
277
+ appl.pwclass = f"{appl.pwclass}_plug"
278
+
272
279
  # Skip thermostats that have this key, should be an orphaned device (Core #81712)
273
280
  if (
274
281
  appl.pwclass == "thermostat"
plugwise/legacy/helper.py CHANGED
@@ -116,6 +116,13 @@ class SmileLegacyHelper(SmileCommon):
116
116
  appl.location = self._home_location
117
117
  appl.dev_id = appliance.attrib["id"]
118
118
  appl.name = appliance.find("name").text
119
+ # Extend device_class name when a Circle/Stealth is type heater_central -- Pw-Beta Issue #739
120
+ if (
121
+ appl.pwclass == "heater_central"
122
+ and appl.name != "Central heating boiler"
123
+ ):
124
+ appl.pwclass = "heater_central_plug"
125
+
119
126
  appl.model = appl.pwclass.replace("_", " ").title()
120
127
  appl.model_id = None
121
128
  appl.firmware = None
plugwise/legacy/smile.py CHANGED
@@ -40,7 +40,7 @@ class SmileLegacyAPI(SmileComm, SmileLegacyData):
40
40
  self,
41
41
  host: str,
42
42
  password: str,
43
- timeout: float,
43
+ timeout: int,
44
44
  websession: aiohttp.ClientSession,
45
45
  _is_thermostat: bool,
46
46
  _on_off_device: bool,
@@ -56,18 +56,18 @@ class SmileLegacyAPI(SmileComm, SmileLegacyData):
56
56
  smile_name: str,
57
57
  smile_type: str,
58
58
  smile_zigbee_mac_address: str | None,
59
- username: str = DEFAULT_USERNAME,
60
59
  port: int = DEFAULT_PORT,
60
+ username: str = DEFAULT_USERNAME,
61
61
  ) -> None:
62
62
  """Set the constructor for this class."""
63
63
  super().__init__(
64
64
  host,
65
65
  password,
66
- websession,
67
- username,
68
66
  port,
69
67
  timeout,
70
- )
68
+ username,
69
+ websession,
70
+ )
71
71
  SmileLegacyData.__init__(self)
72
72
 
73
73
  self._cooling_present = False
plugwise/smile.py CHANGED
@@ -46,7 +46,7 @@ class SmileAPI(SmileComm, SmileData):
46
46
  self,
47
47
  host: str,
48
48
  password: str,
49
- timeout: float,
49
+ timeout: int,
50
50
  websession: aiohttp.ClientSession,
51
51
  _cooling_present: bool,
52
52
  _elga: bool,
@@ -65,17 +65,17 @@ class SmileAPI(SmileComm, SmileData):
65
65
  smile_model_id: str | None,
66
66
  smile_name: str,
67
67
  smile_type: str,
68
- username: str = DEFAULT_USERNAME,
69
68
  port: int = DEFAULT_PORT,
69
+ username: str = DEFAULT_USERNAME,
70
70
  ) -> None:
71
71
  """Set the constructor for this class."""
72
72
  super().__init__(
73
73
  host,
74
74
  password,
75
- websession,
76
- username,
77
75
  port,
78
76
  timeout,
77
+ username,
78
+ websession,
79
79
  )
80
80
  SmileData.__init__(self)
81
81
 
@@ -137,9 +137,12 @@ class SmileAPI(SmileComm, SmileData):
137
137
  await self.full_update_device()
138
138
  self.get_all_devices()
139
139
  if "heater_id" in self.gw_data:
140
- self._heater_id = self.gw_data["heater_id"]
141
- if "cooling_enabled" in self.gw_devices[self._heater_id]["binary_sensors"]:
142
- self._cooling_enabled = self.gw_devices[self._heater_id]["binary_sensors"]["cooling_enabled"]
140
+ heat_cooler = self.gw_devices[self.gw_data["heater_id"]]
141
+ if (
142
+ "binary_sensors" in heat_cooler
143
+ and "cooling_enabled" in heat_cooler["binary_sensors"]
144
+ ):
145
+ self._cooling_enabled = heat_cooler["binary_sensors"]["cooling_enabled"]
143
146
  except KeyError as err:
144
147
  raise DataMissingError("No Plugwise data received") from err
145
148
 
plugwise/util.py CHANGED
@@ -91,7 +91,9 @@ def check_heater_central(xml: etree) -> str:
91
91
  has_actuators: bool = (
92
92
  heater_central.find("actuator_functionalities/") is not None
93
93
  )
94
- hc_list.append({hc_id: has_actuators})
94
+ # Filter for Plug/Circle/Stealth heater_central -- Pw-Beta Issue #739
95
+ if heater_central.find("name").text == "Central heating boiler":
96
+ hc_list.append({hc_id: has_actuators})
95
97
 
96
98
  heater_central_id = list(hc_list[0].keys())[0]
97
99
  if hc_count > 1:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugwise
3
- Version: 1.4.1
3
+ Version: 1.4.2
4
4
  Summary: Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3.
5
5
  Home-page: https://github.com/plugwise/python-plugwise
6
6
  Author: Plugwise device owners
@@ -0,0 +1,17 @@
1
+ plugwise/__init__.py,sha256=QeUbOAPOcSOGIpB8YYjrJZB9O4-fTU7Gy0Q6aUD5rn4,16980
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=5johCmwFuAHbTf05lWpdZ4WaUhVzt9Vb7bksSbFVeq4,18827
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=GFmeceLb4zTx4K7EP-7QMqHSkNvnzEq7GtCWhR55YbE,11313
13
+ plugwise-1.4.2.dist-info/LICENSE,sha256=mL22BjmXtg_wnoDnnaqps5_Bg_VGj_yHueX5lsKwbCc,1144
14
+ plugwise-1.4.2.dist-info/METADATA,sha256=4jWvFMqOXKlCS6aVAzRthFtlYEh0rrbejMJXWiBvh0o,9097
15
+ plugwise-1.4.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
16
+ plugwise-1.4.2.dist-info/top_level.txt,sha256=MYOmktMFf8ZmX6_OE1y9MoCZFfY-L8DA0F2tA2IvE4s,9
17
+ plugwise-1.4.2.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- plugwise/__init__.py,sha256=wA-xl4Cd2mioaKhP31D6dHNu-CM2X-5n8TlQbSIra3k,17035
2
- plugwise/common.py,sha256=geZd-kVQ0F1OTJoUd2WMPxNBVpSLgZ2ID_47ainOMnk,12746
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=05dG0FYCBNwO10P5l7LfeouO5Jrs8i-e0jzftZbgFIw,44074
7
- plugwise/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- plugwise/smile.py,sha256=QEztzHr3dzwoZv6lgXKZqDwwCy4WD-2LlS5FhWBHk48,18762
9
- plugwise/util.py,sha256=lCasQDzYO3CNAIHbLKTK16YJxQKoBrTQkJ1nCMmF17g,8006
10
- plugwise/legacy/data.py,sha256=DsHR9xgiFDg_Vh_6ZpOskw8ZhNQ3CmwjstI3yiH6MEk,3048
11
- plugwise/legacy/helper.py,sha256=7QCJyaR9FaM4EEQxGt2oFJac6Pu5OKoi_LG_GQKzRs4,18012
12
- plugwise/legacy/smile.py,sha256=7oaPZuvxrYRvoA8qWFvtWSwQRFfQl1XXpPjWXn3_xFs,11314
13
- plugwise-1.4.1.dist-info/LICENSE,sha256=mL22BjmXtg_wnoDnnaqps5_Bg_VGj_yHueX5lsKwbCc,1144
14
- plugwise-1.4.1.dist-info/METADATA,sha256=PgAeHxciq6Lly984b9uD3x_UZFm9Tj4xl12w6qPQCOA,9097
15
- plugwise-1.4.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
16
- plugwise-1.4.1.dist-info/top_level.txt,sha256=MYOmktMFf8ZmX6_OE1y9MoCZFfY-L8DA0F2tA2IvE4s,9
17
- plugwise-1.4.1.dist-info/RECORD,,