plugwise 0.37.7__py3-none-any.whl → 0.37.8__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 +13 -3
- plugwise/legacy/smile.py +6 -0
- plugwise/smile.py +48 -34
- {plugwise-0.37.7.dist-info → plugwise-0.37.8.dist-info}/METADATA +1 -1
- {plugwise-0.37.7.dist-info → plugwise-0.37.8.dist-info}/RECORD +8 -8
- {plugwise-0.37.7.dist-info → plugwise-0.37.8.dist-info}/LICENSE +0 -0
- {plugwise-0.37.7.dist-info → plugwise-0.37.8.dist-info}/WHEEL +0 -0
- {plugwise-0.37.7.dist-info → plugwise-0.37.8.dist-info}/top_level.txt +0 -0
plugwise/__init__.py
CHANGED
@@ -306,6 +306,16 @@ class Smile(SmileComm):
|
|
306
306
|
### API Set and HA Service-related Functions ###
|
307
307
|
########################################################################################################
|
308
308
|
|
309
|
+
async def set_select(
|
310
|
+
self,
|
311
|
+
key: str,
|
312
|
+
loc_id: str,
|
313
|
+
option: str,
|
314
|
+
name: str | None = None,
|
315
|
+
) -> None:
|
316
|
+
"""Set the selected option for the applicable Select."""
|
317
|
+
await self._smile_api.set_select(key, loc_id, option, name)
|
318
|
+
|
309
319
|
async def set_schedule_state(
|
310
320
|
self,
|
311
321
|
loc_id: str,
|
@@ -344,15 +354,15 @@ class Smile(SmileComm):
|
|
344
354
|
|
345
355
|
async def set_gateway_mode(self, mode: str) -> None:
|
346
356
|
"""Set the gateway mode."""
|
347
|
-
await self._smile_api.set_gateway_mode(mode)
|
357
|
+
await self._smile_api.set_gateway_mode(mode) # pragma: no cover
|
348
358
|
|
349
359
|
async def set_regulation_mode(self, mode: str) -> None:
|
350
360
|
"""Set the heating regulation mode."""
|
351
|
-
await self._smile_api.set_regulation_mode(mode)
|
361
|
+
await self._smile_api.set_regulation_mode(mode) # pragma: no cover
|
352
362
|
|
353
363
|
async def set_dhw_mode(self, mode: str) -> None:
|
354
364
|
"""Set the domestic hot water heating regulation mode."""
|
355
|
-
await self._smile_api.set_dhw_mode(mode)
|
365
|
+
await self._smile_api.set_dhw_mode(mode) # pragma: no cover
|
356
366
|
|
357
367
|
async def delete_notification(self) -> None:
|
358
368
|
"""Delete the active Plugwise Notification."""
|
plugwise/legacy/smile.py
CHANGED
@@ -182,6 +182,12 @@ class SmileLegacyAPI(SmileComm, SmileLegacyData):
|
|
182
182
|
async def set_regulation_mode(self, mode: str) -> None:
|
183
183
|
"""Set-function placeholder for legacy devices."""
|
184
184
|
|
185
|
+
async def set_select(self, key: str, loc_id: str, option: str, name: str | None) -> None:
|
186
|
+
"""Set the thermostat schedule option."""
|
187
|
+
# schedule state corresponds to select option
|
188
|
+
# schedule name corresponds to select name
|
189
|
+
await self.set_schedule_state("dummy", option, name)
|
190
|
+
|
185
191
|
async def set_schedule_state(self, _: str, state: str, name: str | None) -> None:
|
186
192
|
"""Activate/deactivate the Schedule.
|
187
193
|
|
plugwise/smile.py
CHANGED
@@ -149,39 +149,6 @@ class SmileAPI(SmileComm, SmileData):
|
|
149
149
|
"""Delete the active Plugwise Notification."""
|
150
150
|
await self._request(NOTIFICATIONS, method="delete")
|
151
151
|
|
152
|
-
async def set_dhw_mode(self, mode: str) -> None:
|
153
|
-
"""Set the domestic hot water heating regulation mode."""
|
154
|
-
if mode not in self._dhw_allowed_modes:
|
155
|
-
raise PlugwiseError("Plugwise: invalid dhw mode.")
|
156
|
-
|
157
|
-
uri = f"{APPLIANCES};type=heater_central/domestic_hot_water_mode_control"
|
158
|
-
data = f"<domestic_hot_water_mode_control_functionality><mode>{mode}</mode></domestic_hot_water_mode_control_functionality>"
|
159
|
-
|
160
|
-
await self._request(uri, method="put", data=data)
|
161
|
-
|
162
|
-
async def set_gateway_mode(self, mode: str) -> None:
|
163
|
-
"""Set the gateway mode."""
|
164
|
-
if mode not in self._gw_allowed_modes:
|
165
|
-
raise PlugwiseError("Plugwise: invalid gateway mode.")
|
166
|
-
|
167
|
-
end_time = "2037-04-21T08:00:53.000Z"
|
168
|
-
valid = ""
|
169
|
-
if mode == "away":
|
170
|
-
time_1 = self._domain_objects.find("./gateway/time").text
|
171
|
-
away_time = dt.datetime.fromisoformat(time_1).astimezone(dt.UTC).isoformat(timespec="milliseconds").replace("+00:00", "Z")
|
172
|
-
valid = (
|
173
|
-
f"<valid_from>{away_time}</valid_from><valid_to>{end_time}</valid_to>"
|
174
|
-
)
|
175
|
-
if mode == "vacation":
|
176
|
-
time_2 = str(dt.date.today() - dt.timedelta(1))
|
177
|
-
vacation_time = time_2 + "T23:00:00.000Z"
|
178
|
-
valid = f"<valid_from>{vacation_time}</valid_from><valid_to>{end_time}</valid_to>"
|
179
|
-
|
180
|
-
uri = f"{APPLIANCES};id={self.gateway_id}/gateway_mode_control"
|
181
|
-
data = f"<gateway_mode_control_functionality><mode>{mode}</mode>{valid}</gateway_mode_control_functionality>"
|
182
|
-
|
183
|
-
await self._request(uri, method="put", data=data)
|
184
|
-
|
185
152
|
async def set_number(
|
186
153
|
self,
|
187
154
|
dev_id: str,
|
@@ -241,6 +208,53 @@ class SmileAPI(SmileComm, SmileData):
|
|
241
208
|
|
242
209
|
await self._request(uri, method="put", data=data)
|
243
210
|
|
211
|
+
async def set_select(self, key: str, loc_id: str, option: str, name: str | None) -> None:
|
212
|
+
"""Set a dhw/gateway/regulation mode or the thermostat schedule option."""
|
213
|
+
match key:
|
214
|
+
case "select_dhw_mode":
|
215
|
+
await self.set_dhw_mode(option)
|
216
|
+
case "select_gateway_mode":
|
217
|
+
await self.set_gateway_mode(option)
|
218
|
+
case "select_regulation_mode":
|
219
|
+
await self.set_regulation_mode(option)
|
220
|
+
case "select_schedule":
|
221
|
+
# schedule state corresponds to select option
|
222
|
+
# schedule name corresponds to select name
|
223
|
+
await self.set_schedule_state(loc_id, option, name)
|
224
|
+
|
225
|
+
async def set_dhw_mode(self, mode: str) -> None:
|
226
|
+
"""Set the domestic hot water heating regulation mode."""
|
227
|
+
if mode not in self._dhw_allowed_modes:
|
228
|
+
raise PlugwiseError("Plugwise: invalid dhw mode.")
|
229
|
+
|
230
|
+
uri = f"{APPLIANCES};type=heater_central/domestic_hot_water_mode_control"
|
231
|
+
data = f"<domestic_hot_water_mode_control_functionality><mode>{mode}</mode></domestic_hot_water_mode_control_functionality>"
|
232
|
+
|
233
|
+
await self._request(uri, method="put", data=data)
|
234
|
+
|
235
|
+
async def set_gateway_mode(self, mode: str) -> None:
|
236
|
+
"""Set the gateway mode."""
|
237
|
+
if mode not in self._gw_allowed_modes:
|
238
|
+
raise PlugwiseError("Plugwise: invalid gateway mode.")
|
239
|
+
|
240
|
+
end_time = "2037-04-21T08:00:53.000Z"
|
241
|
+
valid = ""
|
242
|
+
if mode == "away":
|
243
|
+
time_1 = self._domain_objects.find("./gateway/time").text
|
244
|
+
away_time = dt.datetime.fromisoformat(time_1).astimezone(dt.UTC).isoformat(timespec="milliseconds").replace("+00:00", "Z")
|
245
|
+
valid = (
|
246
|
+
f"<valid_from>{away_time}</valid_from><valid_to>{end_time}</valid_to>"
|
247
|
+
)
|
248
|
+
if mode == "vacation":
|
249
|
+
time_2 = str(dt.date.today() - dt.timedelta(1))
|
250
|
+
vacation_time = time_2 + "T23:00:00.000Z"
|
251
|
+
valid = f"<valid_from>{vacation_time}</valid_from><valid_to>{end_time}</valid_to>"
|
252
|
+
|
253
|
+
uri = f"{APPLIANCES};id={self.gateway_id}/gateway_mode_control"
|
254
|
+
data = f"<gateway_mode_control_functionality><mode>{mode}</mode>{valid}</gateway_mode_control_functionality>"
|
255
|
+
|
256
|
+
await self._request(uri, method="put", data=data)
|
257
|
+
|
244
258
|
async def set_regulation_mode(self, mode: str) -> None:
|
245
259
|
"""Set the heating regulation mode."""
|
246
260
|
if mode not in self._reg_allowed_modes:
|
@@ -258,7 +272,7 @@ class SmileAPI(SmileComm, SmileData):
|
|
258
272
|
self,
|
259
273
|
loc_id: str,
|
260
274
|
new_state: str,
|
261
|
-
name: str | None
|
275
|
+
name: str | None,
|
262
276
|
) -> None:
|
263
277
|
"""Activate/deactivate the Schedule, with the given name, on the relevant Thermostat.
|
264
278
|
|
@@ -1,17 +1,17 @@
|
|
1
|
-
plugwise/__init__.py,sha256=
|
1
|
+
plugwise/__init__.py,sha256=M2PEzs84o376ivgo7Jr9yoTP2u5cNINXuxmSbdAS138,14426
|
2
2
|
plugwise/common.py,sha256=P4sUYzgVcFsIR2DmQxeVeOiZvFZWpZXgwHA3XRc1Sx0,12538
|
3
3
|
plugwise/constants.py,sha256=dvafW3u7LBbWUN05D1Tss7s4jxEDJiZDqnh4-q9isUM,16580
|
4
4
|
plugwise/data.py,sha256=9sH2FkwGh5Uvbf42LmZPWutY9Qa-j9qmFZBobwJkLQo,9022
|
5
5
|
plugwise/exceptions.py,sha256=rymGtWnXosdFkzSehc_41HVl2jXJEg_9Hq9APDEUwrk,1223
|
6
6
|
plugwise/helper.py,sha256=nF1xJEw-frvuGMAydFAJrz_tN24Q3PcBnYNIwPeueZg,42817
|
7
7
|
plugwise/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
plugwise/smile.py,sha256=
|
8
|
+
plugwise/smile.py,sha256=6zHEPSyPlTwSOSG-SPPjOOxy7YKM0tnYL3_M09g3rzQ,17866
|
9
9
|
plugwise/util.py,sha256=9ld46KJHWFze2eUrVSgUYn0g3zNerlpboM0iUa0H3ak,7830
|
10
10
|
plugwise/legacy/data.py,sha256=DsHR9xgiFDg_Vh_6ZpOskw8ZhNQ3CmwjstI3yiH6MEk,3048
|
11
11
|
plugwise/legacy/helper.py,sha256=6-tYQMEXepE5rec-hn6lt2EeknADI3J8UFuBSLgu8dk,17878
|
12
|
-
plugwise/legacy/smile.py,sha256
|
13
|
-
plugwise-0.37.
|
14
|
-
plugwise-0.37.
|
15
|
-
plugwise-0.37.
|
16
|
-
plugwise-0.37.
|
17
|
-
plugwise-0.37.
|
12
|
+
plugwise/legacy/smile.py,sha256=-ToQoxDrh6U66zqMxI8xSIRgJL3jusYJb6EjqUETAWA,10803
|
13
|
+
plugwise-0.37.8.dist-info/LICENSE,sha256=mL22BjmXtg_wnoDnnaqps5_Bg_VGj_yHueX5lsKwbCc,1144
|
14
|
+
plugwise-0.37.8.dist-info/METADATA,sha256=MR9hmuhzNEiEI5uJyjMQJL6kSIY1M5p0kCv6HcxGyVU,8939
|
15
|
+
plugwise-0.37.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
16
|
+
plugwise-0.37.8.dist-info/top_level.txt,sha256=MYOmktMFf8ZmX6_OE1y9MoCZFfY-L8DA0F2tA2IvE4s,9
|
17
|
+
plugwise-0.37.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|