plugwise 0.37.2__py3-none-any.whl → 0.37.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 CHANGED
@@ -323,13 +323,14 @@ class Smile(SmileComm):
323
323
  """Set the given Temperature on the relevant Thermostat."""
324
324
  await self._smile_api.set_temperature(loc_id, items)
325
325
 
326
- async def set_number_setpoint(self, key: str, _: str, temperature: float) -> None:
326
+ async def set_number(
327
+ self,
328
+ key: str,
329
+ temperature: float,
330
+ dev_id: str | None = None,
331
+ ) -> None:
327
332
  """Set the max. Boiler or DHW setpoint on the Central Heating boiler."""
328
- await self._smile_api.set_number_setpoint(key, temperature)
329
-
330
- async def set_temperature_offset(self, _: str, dev_id: str, offset: float) -> None:
331
- """Set the Temperature offset for thermostats that support this feature."""
332
- await self._smile_api.set_temperature_offset(dev_id, offset)
333
+ await self._smile_api.set_number(key, temperature, dev_id)
333
334
 
334
335
  async def set_switch_state(
335
336
  self, appl_id: str, members: list[str] | None, model: str, state: str
plugwise/legacy/smile.py CHANGED
@@ -154,7 +154,12 @@ class SmileLegacyAPI(SmileComm, SmileLegacyData):
154
154
  async def set_gateway_mode(self, mode: str) -> None:
155
155
  """Set-function placeholder for legacy devices."""
156
156
 
157
- async def set_number_setpoint(self, key: str, temperature: float) -> None:
157
+ async def set_number(
158
+ self,
159
+ key: str,
160
+ temperature: float,
161
+ dev_id: str | None,
162
+ ) -> None:
158
163
  """Set-function placeholder for legacy devices."""
159
164
 
160
165
  async def set_preset(self, _: str, preset: str) -> None:
@@ -249,8 +254,12 @@ class SmileLegacyAPI(SmileComm, SmileLegacyData):
249
254
 
250
255
  await self._request(uri, method="put", data=data)
251
256
 
252
- async def set_temperature(self, setpoint: str, _: dict[str, float]) -> None:
257
+ async def set_temperature(self, _: str, items: dict[str, float]) -> None:
253
258
  """Set the given Temperature on the relevant Thermostat."""
259
+ setpoint: float | None = None
260
+ if "setpoint" in items:
261
+ setpoint = items["setpoint"]
262
+
254
263
  if setpoint is None:
255
264
  raise PlugwiseError(
256
265
  "Plugwise: failed setting temperature: no valid input provided"
@@ -264,6 +273,3 @@ class SmileLegacyAPI(SmileComm, SmileLegacyData):
264
273
  )
265
274
 
266
275
  await self._request(uri, method="put", data=data)
267
-
268
- async def set_temperature_offset(self, dev_id: str, offset: float) -> None:
269
- """Set-function placeholder for legacy devices."""
plugwise/smile.py CHANGED
@@ -182,8 +182,17 @@ class SmileAPI(SmileComm, SmileData):
182
182
 
183
183
  await self._request(uri, method="put", data=data)
184
184
 
185
- async def set_number_setpoint(self, key: str, temperature: float) -> None:
186
- """Set the max. Boiler or DHW setpoint on the Central Heating boiler."""
185
+ async def set_number(
186
+ self,
187
+ key: str,
188
+ temperature: float,
189
+ dev_id: str | None,
190
+ ) -> None:
191
+ """Set the maximum boiler- or DHW-setpoint on the Central Heating boiler or the temperature-offset on a Thermostat."""
192
+ if dev_id is not None:
193
+ await self.set_offset(dev_id, temperature)
194
+ return
195
+
187
196
  temp = str(temperature)
188
197
  thermostat_id: str | None = None
189
198
  locator = f'appliance[@id="{self._heater_id}"]/actuator_functionalities/thermostat_functionality'
@@ -199,6 +208,19 @@ class SmileAPI(SmileComm, SmileData):
199
208
  data = f"<thermostat_functionality><setpoint>{temp}</setpoint></thermostat_functionality>"
200
209
  await self._request(uri, method="put", data=data)
201
210
 
211
+ async def set_offset(self, dev_id: str, offset: float) -> None:
212
+ """Set the Temperature offset for thermostats that support this feature."""
213
+ if dev_id not in self.therms_with_offset_func:
214
+ raise PlugwiseError(
215
+ "Plugwise: this device does not have temperature-offset capability."
216
+ )
217
+
218
+ value = str(offset)
219
+ uri = f"{APPLIANCES};id={dev_id}/offset;type=temperature_offset"
220
+ data = f"<offset_functionality><offset>{value}</offset></offset_functionality>"
221
+
222
+ await self._request(uri, method="put", data=data)
223
+
202
224
  async def set_preset(self, loc_id: str, preset: str) -> None:
203
225
  """Set the given Preset on the relevant Thermostat - from LOCATIONS."""
204
226
  if (presets := self._presets(loc_id)) is None:
@@ -410,16 +432,3 @@ class SmileAPI(SmileComm, SmileData):
410
432
  )
411
433
 
412
434
  await self._request(uri, method="put", data=data)
413
-
414
- async def set_temperature_offset(self, dev_id: str, offset: float) -> None:
415
- """Set the Temperature offset for thermostats that support this feature."""
416
- if dev_id not in self.therms_with_offset_func:
417
- raise PlugwiseError(
418
- "Plugwise: this device does not have temperature-offset capability."
419
- )
420
-
421
- value = str(offset)
422
- uri = f"{APPLIANCES};id={dev_id}/offset;type=temperature_offset"
423
- data = f"<offset_functionality><offset>{value}</offset></offset_functionality>"
424
-
425
- await self._request(uri, method="put", data=data)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugwise
3
- Version: 0.37.2
3
+ Version: 0.37.4
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
@@ -35,7 +35,6 @@ Classifier: Development Status :: 5 - Production/Stable
35
35
  Classifier: Intended Audience :: Developers
36
36
  Classifier: License :: OSI Approved :: MIT License
37
37
  Classifier: Operating System :: OS Independent
38
- Classifier: Programming Language :: Python :: 3.11
39
38
  Classifier: Programming Language :: Python :: 3.12
40
39
  Classifier: Topic :: Home Automation
41
40
  Requires-Python: >=3.11.0
@@ -1,17 +1,17 @@
1
- plugwise/__init__.py,sha256=A0XCK9xmhzLGSsy0bAGr2tnKfGDUlJ7WzQfeIqCCd8A,14004
1
+ plugwise/__init__.py,sha256=VDmk0QDi3sDHKlzXLEq4SRm9dUwiWqruXvf_6mNTH6o,13810
2
2
  plugwise/common.py,sha256=P4sUYzgVcFsIR2DmQxeVeOiZvFZWpZXgwHA3XRc1Sx0,12538
3
3
  plugwise/constants.py,sha256=adi2UFHJUcPRWNz1bn155NC9DLzhYbeNriMKTpSyWAg,16574
4
4
  plugwise/data.py,sha256=OTkPJ80b1L1h_TeddfvmUPX1-jBacTjbHKD0XgUIfeg,8965
5
5
  plugwise/exceptions.py,sha256=rymGtWnXosdFkzSehc_41HVl2jXJEg_9Hq9APDEUwrk,1223
6
6
  plugwise/helper.py,sha256=bNT_Tdc0LAxmVZEikMgKm461jeGP-WY-cI1r3JGgIcI,44037
7
7
  plugwise/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- plugwise/smile.py,sha256=_1VFG81pfuy673M8kGQVfpSX3Kdin2Xl7-KsUXNpGlY,16985
8
+ plugwise/smile.py,sha256=YK41CbqMSAQytPOeBiHkXEvinCU5Sm7hDaYUpeqnVCA,17175
9
9
  plugwise/util.py,sha256=w24CiW-xSV3ARZAeNYZ9T5C4kJpYGCcBoIlX2BhNOYg,6618
10
10
  plugwise/legacy/data.py,sha256=y7gBG9Sg40lltB3B5CpWPtAXggMbcx2IMay-mwvOB1M,2986
11
11
  plugwise/legacy/helper.py,sha256=tSrqA2UeMO7HSYudQHAxBThBTevAOKIxHqN6NCN-r5k,18947
12
- plugwise/legacy/smile.py,sha256=_oyI7zZhqT9Vced8jHQxN-eWIiaR4xuWKAxEBDQVfF4,10238
13
- plugwise-0.37.2.dist-info/LICENSE,sha256=mL22BjmXtg_wnoDnnaqps5_Bg_VGj_yHueX5lsKwbCc,1144
14
- plugwise-0.37.2.dist-info/METADATA,sha256=YlNRTSOSaB8X-lZ0pdEun3q3Z2aEzO82NOgYqOQgDgQ,8990
15
- plugwise-0.37.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
16
- plugwise-0.37.2.dist-info/top_level.txt,sha256=MYOmktMFf8ZmX6_OE1y9MoCZFfY-L8DA0F2tA2IvE4s,9
17
- plugwise-0.37.2.dist-info/RECORD,,
12
+ plugwise/legacy/smile.py,sha256=J5y5tIPCz-zpp_4G_TB8II6jy6xNaIJeiAsmxGsondk,10257
13
+ plugwise-0.37.4.dist-info/LICENSE,sha256=mL22BjmXtg_wnoDnnaqps5_Bg_VGj_yHueX5lsKwbCc,1144
14
+ plugwise-0.37.4.dist-info/METADATA,sha256=HF9iqxV-J1vKOXOq7C0BmugM7dCX9qb6o9rx_qkSENw,8939
15
+ plugwise-0.37.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
16
+ plugwise-0.37.4.dist-info/top_level.txt,sha256=MYOmktMFf8ZmX6_OE1y9MoCZFfY-L8DA0F2tA2IvE4s,9
17
+ plugwise-0.37.4.dist-info/RECORD,,