plugwise 1.7.7__tar.gz → 1.7.8a1__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.
Files changed (32) hide show
  1. {plugwise-1.7.7 → plugwise-1.7.8a1}/PKG-INFO +1 -1
  2. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise.egg-info/PKG-INFO +1 -1
  3. {plugwise-1.7.7 → plugwise-1.7.8a1}/pyproject.toml +1 -1
  4. {plugwise-1.7.7 → plugwise-1.7.8a1}/tests/test_adam.py +120 -128
  5. {plugwise-1.7.7 → plugwise-1.7.8a1}/tests/test_anna.py +110 -121
  6. {plugwise-1.7.7 → plugwise-1.7.8a1}/tests/test_generic.py +2 -2
  7. {plugwise-1.7.7 → plugwise-1.7.8a1}/tests/test_init.py +66 -68
  8. {plugwise-1.7.7 → plugwise-1.7.8a1}/tests/test_legacy_anna.py +20 -22
  9. {plugwise-1.7.7 → plugwise-1.7.8a1}/tests/test_legacy_generic.py +1 -1
  10. {plugwise-1.7.7 → plugwise-1.7.8a1}/tests/test_legacy_p1.py +12 -12
  11. {plugwise-1.7.7 → plugwise-1.7.8a1}/tests/test_legacy_stretch.py +22 -22
  12. {plugwise-1.7.7 → plugwise-1.7.8a1}/tests/test_p1.py +15 -15
  13. {plugwise-1.7.7 → plugwise-1.7.8a1}/LICENSE +0 -0
  14. {plugwise-1.7.7 → plugwise-1.7.8a1}/README.md +0 -0
  15. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/__init__.py +0 -0
  16. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/common.py +0 -0
  17. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/constants.py +0 -0
  18. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/data.py +0 -0
  19. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/exceptions.py +0 -0
  20. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/helper.py +0 -0
  21. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/legacy/data.py +0 -0
  22. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/legacy/helper.py +0 -0
  23. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/legacy/smile.py +0 -0
  24. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/py.typed +0 -0
  25. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/smile.py +0 -0
  26. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/smilecomm.py +0 -0
  27. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise/util.py +0 -0
  28. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise.egg-info/SOURCES.txt +0 -0
  29. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise.egg-info/dependency_links.txt +0 -0
  30. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise.egg-info/requires.txt +0 -0
  31. {plugwise-1.7.7 → plugwise-1.7.8a1}/plugwise.egg-info/top_level.txt +0 -0
  32. {plugwise-1.7.7 → plugwise-1.7.8a1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plugwise
3
- Version: 1.7.7
3
+ Version: 1.7.8a1
4
4
  Summary: Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3.
5
5
  Author: Plugwise device owners
6
6
  Maintainer: bouwew, CoMPaTech
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plugwise
3
- Version: 1.7.7
3
+ Version: 1.7.8a1
4
4
  Summary: Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3.
5
5
  Author: Plugwise device owners
6
6
  Maintainer: bouwew, CoMPaTech
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "plugwise"
7
- version = "1.7.7"
7
+ version = "1.7.8a1"
8
8
  license = "MIT"
9
9
  description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3."
10
10
  readme = "README.md"
@@ -22,20 +22,20 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
22
22
  self.smile_setup = "adam_plus_anna_new"
23
23
 
24
24
  testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup)
25
- server, smile, client = await self.connect_wrapper()
26
- assert smile.smile.hostname == "smile000000"
25
+ server, api, client = await self.connect_wrapper()
26
+ assert api.smile.hostname == "smile000000"
27
27
 
28
28
  self.validate_test_basics(
29
29
  _LOGGER,
30
- smile,
30
+ api,
31
31
  smile_type=None,
32
32
  smile_version="3.7.8",
33
33
  )
34
34
 
35
- await self.device_test(smile, "2023-12-17 00:00:01", testdata)
36
- assert smile.gateway_id == "da224107914542988a88561b4452b0f6"
37
- assert smile._last_active["f2bf9048bef64cc5b6d5110154e33c81"] == "Weekschema"
38
- assert smile._last_active["f871b8c4d63549319221e294e4f88074"] == "Badkamer"
35
+ await self.device_test(api, "2023-12-17 00:00:01", testdata)
36
+ assert api.gateway_id == "da224107914542988a88561b4452b0f6"
37
+ assert api._last_active["f2bf9048bef64cc5b6d5110154e33c81"] == "Weekschema"
38
+ assert api._last_active["f871b8c4d63549319221e294e4f88074"] == "Badkamer"
39
39
  assert self.entity_items == 178
40
40
  assert self.entity_list == [
41
41
  "da224107914542988a88561b4452b0f6",
@@ -52,24 +52,24 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
52
52
  "f2bf9048bef64cc5b6d5110154e33c81",
53
53
  "f871b8c4d63549319221e294e4f88074",
54
54
  ]
55
- assert smile.reboot
55
+ assert api.reboot
56
56
 
57
57
  result = await self.tinker_thermostat(
58
- smile,
58
+ api,
59
59
  "f2bf9048bef64cc5b6d5110154e33c81",
60
60
  good_schedules=["Weekschema", "Badkamer", "Test"],
61
61
  )
62
62
  assert result
63
63
 
64
64
  # Special test-case for turning a schedule off based on only the location id.
65
- await smile.set_schedule_state("f2bf9048bef64cc5b6d5110154e33c81", "off")
65
+ await api.set_schedule_state("f2bf9048bef64cc5b6d5110154e33c81", "off")
66
66
 
67
67
  # Special test-case for turning a schedule off for a location via the option "off".
68
- await smile.set_schedule_state("f2bf9048bef64cc5b6d5110154e33c81", "on", "off")
68
+ await api.set_schedule_state("f2bf9048bef64cc5b6d5110154e33c81", "on", "off")
69
69
 
70
70
  # bad schedule-state test
71
71
  result = await self.tinker_thermostat_schedule(
72
- smile,
72
+ api,
73
73
  "f2bf9048bef64cc5b6d5110154e33c81",
74
74
  "bad",
75
75
  good_schedules=["Badkamer"],
@@ -77,18 +77,16 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
77
77
  )
78
78
  assert result
79
79
 
80
- smile._schedule_old_states["f2bf9048bef64cc5b6d5110154e33c81"]["Badkamer"] = (
81
- "off"
82
- )
80
+ api._schedule_old_states["f2bf9048bef64cc5b6d5110154e33c81"]["Badkamer"] = "off"
83
81
  result_1 = await self.tinker_thermostat_schedule(
84
- smile,
82
+ api,
85
83
  "f2bf9048bef64cc5b6d5110154e33c81",
86
84
  "on",
87
85
  good_schedules=["Badkamer"],
88
86
  single=True,
89
87
  )
90
88
  result_2 = await self.tinker_thermostat_schedule(
91
- smile,
89
+ api,
92
90
  "f2bf9048bef64cc5b6d5110154e33c81",
93
91
  "on",
94
92
  good_schedules=["Badkamer"],
@@ -97,44 +95,44 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
97
95
  assert result_1 and result_2
98
96
 
99
97
  switch_change = await self.tinker_switch(
100
- smile,
98
+ api,
101
99
  "e8ef2a01ed3b4139a53bf749204fe6b4",
102
100
  ["2568cc4b9c1e401495d4741a5f89bee1", "29542b2b6a6a4169acecc15c72a599b8"],
103
101
  )
104
102
  assert switch_change
105
103
  switch_change = await self.tinker_switch(
106
- smile, "056ee145a816487eaa69243c3280f8bf", model="dhw_cm_switch"
104
+ api, "056ee145a816487eaa69243c3280f8bf", model="dhw_cm_switch"
107
105
  )
108
106
  assert switch_change
109
107
  # Test relay without lock-attribute
110
108
  switch_change = await self.tinker_switch(
111
- smile,
109
+ api,
112
110
  "854f8a9b0e7e425db97f1f110e1ce4b3",
113
111
  )
114
112
  assert not switch_change
115
113
  switch_change = await self.tinker_switch(
116
- smile, "2568cc4b9c1e401495d4741a5f89bee1"
114
+ api, "2568cc4b9c1e401495d4741a5f89bee1"
117
115
  )
118
116
  assert not switch_change
119
117
  switch_change = await self.tinker_switch(
120
- smile,
118
+ api,
121
119
  "2568cc4b9c1e401495d4741a5f89bee1",
122
120
  model="lock",
123
121
  )
124
122
  assert switch_change
125
123
 
126
124
  assert await self.tinker_switch_bad_input(
127
- smile,
125
+ api,
128
126
  "854f8a9b0e7e425db97f1f110e1ce4b3",
129
127
  )
130
128
 
131
- tinkered = await self.tinker_gateway_mode(smile)
129
+ tinkered = await self.tinker_gateway_mode(api)
132
130
  assert not tinkered
133
131
 
134
- tinkered = await self.tinker_regulation_mode(smile)
132
+ tinkered = await self.tinker_regulation_mode(api)
135
133
  assert not tinkered
136
134
 
137
- tinkered = await self.tinker_max_boiler_temp(smile)
135
+ tinkered = await self.tinker_max_boiler_temp(api)
138
136
  assert not tinkered
139
137
 
140
138
  # Now change some data and change directory reading xml from
@@ -144,13 +142,13 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
144
142
  )
145
143
  self.smile_setup = "updated/adam_plus_anna_new"
146
144
  await self.device_test(
147
- smile, "2022-01-16 00:00:01", testdata_updated, initialize=False
145
+ api, "2022-01-16 00:00:01", testdata_updated, initialize=False
148
146
  )
149
147
 
150
148
  # Simulate receiving no xml-data after a requesting a reboot of the gateway
151
149
  self.smile_setup = "reboot/adam_plus_anna_new"
152
150
  try:
153
- await self.device_test(smile, initialize=False)
151
+ await self.device_test(api, initialize=False)
154
152
  except pw_exceptions.PlugwiseError as err:
155
153
  _LOGGER.debug(
156
154
  f"Receiving no data after a reboot is properly handled: {err}"
@@ -159,30 +157,28 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
159
157
  # Simulate receiving xml-data with <error>
160
158
  self.smile_setup = "error/adam_plus_anna_new"
161
159
  try:
162
- await self.device_test(smile, initialize=False)
160
+ await self.device_test(api, initialize=False)
163
161
  except pw_exceptions.ResponseError:
164
162
  _LOGGER.debug("Receiving error-data from the Gateway")
165
163
 
166
- await smile.close_connection()
164
+ await api.close_connection()
167
165
  await self.disconnect(server, client)
168
166
 
169
167
  self.smile_setup = "adam_plus_anna_new"
170
168
  testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup)
171
- server, smile, client = await self.connect_wrapper(raise_timeout=True)
172
- await self.device_test(
173
- smile, "2023-12-17 00:00:01", testdata, skip_testing=True
174
- )
169
+ server, api, client = await self.connect_wrapper(raise_timeout=True)
170
+ await self.device_test(api, "2023-12-17 00:00:01", testdata, skip_testing=True)
175
171
 
176
- tinkered = await self.tinker_max_boiler_temp(smile, unhappy=True)
172
+ tinkered = await self.tinker_max_boiler_temp(api, unhappy=True)
177
173
  assert tinkered
178
174
 
179
- tinkered = await self.tinker_gateway_mode(smile, unhappy=True)
175
+ tinkered = await self.tinker_gateway_mode(api, unhappy=True)
180
176
  assert tinkered
181
177
 
182
- tinkered = await self.tinker_regulation_mode(smile, unhappy=True)
178
+ tinkered = await self.tinker_regulation_mode(api, unhappy=True)
183
179
  assert tinkered
184
180
 
185
- await smile.close_connection()
181
+ await api.close_connection()
186
182
  await self.disconnect(server, client)
187
183
 
188
184
  @pytest.mark.asyncio
@@ -191,12 +187,12 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
191
187
  self.smile_setup = "adam_plus_anna_new_regulation_off"
192
188
 
193
189
  testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup)
194
- server, smile, client = await self.connect_wrapper()
195
- assert smile.smile.hostname == "smile000000"
190
+ server, api, client = await self.connect_wrapper()
191
+ assert api.smile.hostname == "smile000000"
196
192
 
197
- await self.device_test(smile, "2023-12-17 00:00:01", testdata)
193
+ await self.device_test(api, "2023-12-17 00:00:01", testdata)
198
194
 
199
- await smile.close_connection()
195
+ await api.close_connection()
200
196
  await self.disconnect(server, client)
201
197
 
202
198
  @pytest.mark.asyncio
@@ -205,79 +201,77 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
205
201
  self.smile_setup = "adam_zone_per_device"
206
202
 
207
203
  testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup)
208
- server, smile, client = await self.connect_wrapper()
209
- assert smile.smile.hostname == "smile000000"
204
+ server, api, client = await self.connect_wrapper()
205
+ assert api.smile.hostname == "smile000000"
210
206
 
211
207
  self.validate_test_basics(
212
208
  _LOGGER,
213
- smile,
209
+ api,
214
210
  smile_version="3.0.15",
215
211
  )
216
212
 
217
- await self.device_test(smile, "2022-05-16 00:00:01", testdata)
218
- assert smile.gateway_id == "fe799307f1624099878210aa0b9f1475"
219
- assert smile._last_active["12493538af164a409c6a1c79e38afe1c"] == BADKAMER_SCHEMA
220
- assert smile._last_active["c50f167537524366a5af7aa3942feb1e"] == GF7_WOONKAMER
221
- assert smile._last_active["82fa13f017d240daa0d0ea1775420f24"] == CV_JESSIE
222
- assert smile._last_active["08963fec7c53423ca5680aa4cb502c63"] == BADKAMER_SCHEMA
223
- assert smile._last_active["446ac08dd04d4eff8ac57489757b7314"] == BADKAMER_SCHEMA
213
+ await self.device_test(api, "2022-05-16 00:00:01", testdata)
214
+ assert api.gateway_id == "fe799307f1624099878210aa0b9f1475"
215
+ assert api._last_active["12493538af164a409c6a1c79e38afe1c"] == BADKAMER_SCHEMA
216
+ assert api._last_active["c50f167537524366a5af7aa3942feb1e"] == GF7_WOONKAMER
217
+ assert api._last_active["82fa13f017d240daa0d0ea1775420f24"] == CV_JESSIE
218
+ assert api._last_active["08963fec7c53423ca5680aa4cb502c63"] == BADKAMER_SCHEMA
219
+ assert api._last_active["446ac08dd04d4eff8ac57489757b7314"] == BADKAMER_SCHEMA
224
220
  assert self.entity_items == 370
225
221
 
226
222
  assert "af82e4ccf9c548528166d38e560662a4" in self.notifications
227
- await smile.delete_notification()
223
+ await api.delete_notification()
228
224
 
229
225
  result = await self.tinker_thermostat(
230
- smile, "c50f167537524366a5af7aa3942feb1e", good_schedules=[GF7_WOONKAMER]
226
+ api, "c50f167537524366a5af7aa3942feb1e", good_schedules=[GF7_WOONKAMER]
231
227
  )
232
228
  assert result
233
229
  result = await self.tinker_thermostat(
234
- smile, "82fa13f017d240daa0d0ea1775420f24", good_schedules=[CV_JESSIE]
230
+ api, "82fa13f017d240daa0d0ea1775420f24", good_schedules=[CV_JESSIE]
235
231
  )
236
232
  assert result
237
233
  switch_change = await self.tinker_switch(
238
- smile, "675416a629f343c495449970e2ca37b5"
234
+ api, "675416a629f343c495449970e2ca37b5"
239
235
  )
240
236
  assert not switch_change
241
237
 
242
- reboot = await self.tinker_reboot(smile)
238
+ reboot = await self.tinker_reboot(api)
243
239
  assert reboot
244
240
 
245
- await smile.close_connection()
241
+ await api.close_connection()
246
242
  await self.disconnect(server, client)
247
243
 
248
- server, smile, client = await self.connect_wrapper(raise_timeout=True)
249
- await self.device_test(
250
- smile, "2022-05-16 00:00:01", testdata, skip_testing=True
251
- )
244
+ server, api, client = await self.connect_wrapper(raise_timeout=True)
245
+ await self.device_test(api, "2022-05-16 00:00:01", testdata, skip_testing=True)
252
246
  result = await self.tinker_thermostat(
253
- smile,
247
+ api,
254
248
  "c50f167537524366a5af7aa3942feb1e",
255
249
  good_schedules=[GF7_WOONKAMER],
256
250
  unhappy=True,
257
251
  )
258
252
  assert result
259
253
  result = await self.tinker_thermostat(
260
- smile,
254
+ api,
261
255
  "82fa13f017d240daa0d0ea1775420f24",
262
256
  good_schedules=[CV_JESSIE],
263
257
  unhappy=True,
264
258
  )
265
259
  assert result
266
260
 
267
- tinkered = await self.tinker_max_boiler_temp(smile, unhappy=True)
261
+ tinkered = await self.tinker_max_boiler_temp(api, unhappy=True)
268
262
  assert not tinkered
269
263
 
270
264
  try:
271
- await smile.delete_notification()
265
+ await api.delete_notification()
272
266
  notification_deletion = False # pragma: no cover
273
267
  except pw_exceptions.ConnectionFailedError:
274
268
  notification_deletion = True
275
269
  assert notification_deletion
276
270
 
277
- reboot = await self.tinker_reboot(smile, unhappy=True)
271
+ reboot = await self.tinker_reboot(api, unhappy=True)
278
272
  assert reboot
279
273
 
280
- await smile.close_connection()
274
+ await api.close_connection()
281
275
  await self.disconnect(server, client)
282
276
 
283
277
  @pytest.mark.asyncio
@@ -286,46 +280,46 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
286
280
  self.smile_setup = "adam_multiple_devices_per_zone"
287
281
 
288
282
  testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup)
289
- server, smile, client = await self.connect_wrapper()
290
- assert smile.smile.hostname == "smile000000"
283
+ server, api, client = await self.connect_wrapper()
284
+ assert api.smile.hostname == "smile000000"
291
285
 
292
286
  self.validate_test_basics(
293
287
  _LOGGER,
294
- smile,
288
+ api,
295
289
  smile_version="3.0.15",
296
290
  )
297
291
 
298
- await self.device_test(smile, "2022-05-16 00:00:01", testdata)
299
- assert smile._last_active["12493538af164a409c6a1c79e38afe1c"] == BADKAMER_SCHEMA
300
- assert smile._last_active["c50f167537524366a5af7aa3942feb1e"] == GF7_WOONKAMER
301
- assert smile._last_active["82fa13f017d240daa0d0ea1775420f24"] == CV_JESSIE
302
- assert smile._last_active["08963fec7c53423ca5680aa4cb502c63"] == BADKAMER_SCHEMA
303
- assert smile._last_active["446ac08dd04d4eff8ac57489757b7314"] == BADKAMER_SCHEMA
292
+ await self.device_test(api, "2022-05-16 00:00:01", testdata)
293
+ assert api._last_active["12493538af164a409c6a1c79e38afe1c"] == BADKAMER_SCHEMA
294
+ assert api._last_active["c50f167537524366a5af7aa3942feb1e"] == GF7_WOONKAMER
295
+ assert api._last_active["82fa13f017d240daa0d0ea1775420f24"] == CV_JESSIE
296
+ assert api._last_active["08963fec7c53423ca5680aa4cb502c63"] == BADKAMER_SCHEMA
297
+ assert api._last_active["446ac08dd04d4eff8ac57489757b7314"] == BADKAMER_SCHEMA
304
298
  assert self.entity_items == 375
305
299
 
306
300
  assert "af82e4ccf9c548528166d38e560662a4" in self.notifications
307
301
 
308
302
  result = await self.tinker_thermostat(
309
- smile, "c50f167537524366a5af7aa3942feb1e", good_schedules=[GF7_WOONKAMER]
303
+ api, "c50f167537524366a5af7aa3942feb1e", good_schedules=[GF7_WOONKAMER]
310
304
  )
311
305
  assert result
312
306
  result = await self.tinker_thermostat(
313
- smile, "82fa13f017d240daa0d0ea1775420f24", good_schedules=[CV_JESSIE]
307
+ api, "82fa13f017d240daa0d0ea1775420f24", good_schedules=[CV_JESSIE]
314
308
  )
315
309
  assert result
316
310
  switch_change = await self.tinker_switch(
317
- smile, "675416a629f343c495449970e2ca37b5"
311
+ api, "675416a629f343c495449970e2ca37b5"
318
312
  )
319
313
  assert not switch_change
320
314
  # Test a blocked group-change, both relays are locked.
321
315
  group_change = await self.tinker_switch(
322
- smile,
316
+ api,
323
317
  "e8ef2a01ed3b4139a53bf749204fe6b4",
324
318
  ["02cf28bfec924855854c544690a609ef", "4a810418d5394b3f82727340b91ba740"],
325
319
  )
326
320
  assert not group_change
327
321
 
328
- await smile.close_connection()
322
+ await api.close_connection()
329
323
  await self.disconnect(server, client)
330
324
 
331
325
  @pytest.mark.asyncio
@@ -334,24 +328,24 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
334
328
  self.smile_setup = "adam_heatpump_cooling"
335
329
 
336
330
  testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup)
337
- server, smile, client = await self.connect_wrapper()
338
-
339
- await self.device_test(smile, "2022-01-02 00:00:01", testdata)
340
- assert smile._last_active["b52908550469425b812c87f766fe5303"] == WERKDAG_SCHEMA
341
- assert smile._last_active["20e735858f8146cead98b873177a4f99"] == WERKDAG_SCHEMA
342
- assert smile._last_active["e39529c79ab54fda9bed26cfc0447546"] == WERKDAG_SCHEMA
343
- assert smile._last_active["9a27714b970547ee9a6bdadc2b815ad5"] == WERKDAG_SCHEMA
344
- assert smile._last_active["93ac3f7bf25342f58cbb77c4a99ac0b3"] == WERKDAG_SCHEMA
345
- assert smile._last_active["fa5fa6b34f6b40a0972988b20e888ed4"] == WERKDAG_SCHEMA
346
- assert smile._last_active["04b15f6e884448288f811d29fb7b1b30"] == WERKDAG_SCHEMA
347
- assert smile._last_active["a562019b0b1f47a4bde8ebe3dbe3e8a9"] == WERKDAG_SCHEMA
348
- assert smile._last_active["8cf650a4c10c44819e426bed406aec34"] == WERKDAG_SCHEMA
349
- assert smile._last_active["5cc21042f87f4b4c94ccb5537c47a53f"] == WERKDAG_SCHEMA
331
+ server, api, client = await self.connect_wrapper()
332
+
333
+ await self.device_test(api, "2022-01-02 00:00:01", testdata)
334
+ assert api._last_active["b52908550469425b812c87f766fe5303"] == WERKDAG_SCHEMA
335
+ assert api._last_active["20e735858f8146cead98b873177a4f99"] == WERKDAG_SCHEMA
336
+ assert api._last_active["e39529c79ab54fda9bed26cfc0447546"] == WERKDAG_SCHEMA
337
+ assert api._last_active["9a27714b970547ee9a6bdadc2b815ad5"] == WERKDAG_SCHEMA
338
+ assert api._last_active["93ac3f7bf25342f58cbb77c4a99ac0b3"] == WERKDAG_SCHEMA
339
+ assert api._last_active["fa5fa6b34f6b40a0972988b20e888ed4"] == WERKDAG_SCHEMA
340
+ assert api._last_active["04b15f6e884448288f811d29fb7b1b30"] == WERKDAG_SCHEMA
341
+ assert api._last_active["a562019b0b1f47a4bde8ebe3dbe3e8a9"] == WERKDAG_SCHEMA
342
+ assert api._last_active["8cf650a4c10c44819e426bed406aec34"] == WERKDAG_SCHEMA
343
+ assert api._last_active["5cc21042f87f4b4c94ccb5537c47a53f"] == WERKDAG_SCHEMA
350
344
  assert self.entity_items == 498
351
345
  assert self.cooling_present
352
346
  assert self._cooling_enabled
353
347
 
354
- await smile.close_connection()
348
+ await api.close_connection()
355
349
  await self.disconnect(server, client)
356
350
 
357
351
  @pytest.mark.asyncio
@@ -360,21 +354,21 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
360
354
  self.smile_setup = "adam_onoff_cooling_fake_firmware"
361
355
 
362
356
  testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup)
363
- server, smile, client = await self.connect_wrapper()
364
- assert smile.smile.hostname == "smile000000"
357
+ server, api, client = await self.connect_wrapper()
358
+ assert api.smile.hostname == "smile000000"
365
359
 
366
360
  self.validate_test_basics(
367
361
  _LOGGER,
368
- smile,
362
+ api,
369
363
  smile_version=None,
370
364
  )
371
365
 
372
- await self.device_test(smile, "2022-01-02 00:00:01", testdata)
366
+ await self.device_test(api, "2022-01-02 00:00:01", testdata)
373
367
  assert self.entity_items == 65
374
368
  assert self.cooling_present
375
369
  # assert self._cooling_enabled - no cooling_enabled indication present
376
370
 
377
- await smile.close_connection()
371
+ await api.close_connection()
378
372
  await self.disconnect(server, client)
379
373
 
380
374
  @pytest.mark.asyncio
@@ -383,48 +377,46 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
383
377
  self.smile_setup = "adam_plus_anna"
384
378
 
385
379
  testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup)
386
- server, smile, client = await self.connect_wrapper()
387
- assert smile.smile.hostname == "smile000000"
380
+ server, api, client = await self.connect_wrapper()
381
+ assert api.smile.hostname == "smile000000"
388
382
 
389
383
  self.validate_test_basics(
390
384
  _LOGGER,
391
- smile,
385
+ api,
392
386
  smile_version="3.0.15",
393
387
  )
394
388
 
395
- await self.device_test(smile, "2020-03-22 00:00:01", testdata)
396
- assert smile.gateway_id == "b128b4bbbd1f47e9bf4d756e8fb5ee94"
397
- assert smile._last_active["009490cc2f674ce6b576863fbb64f867"] == "Weekschema"
389
+ await self.device_test(api, "2020-03-22 00:00:01", testdata)
390
+ assert api.gateway_id == "b128b4bbbd1f47e9bf4d756e8fb5ee94"
391
+ assert api._last_active["009490cc2f674ce6b576863fbb64f867"] == "Weekschema"
398
392
  assert self.entity_items == 81
399
393
  assert "6fb89e35caeb4b1cb275184895202d84" in self.notifications
400
394
 
401
395
  result = await self.tinker_thermostat(
402
- smile, "009490cc2f674ce6b576863fbb64f867", good_schedules=["Weekschema"]
396
+ api, "009490cc2f674ce6b576863fbb64f867", good_schedules=["Weekschema"]
403
397
  )
404
398
  assert result
405
399
  switch_change = await self.tinker_switch(
406
- smile, "aa6b0002df0a46e1b1eb94beb61eddfe"
400
+ api, "aa6b0002df0a46e1b1eb94beb61eddfe"
407
401
  )
408
402
  assert switch_change
409
- await smile.close_connection()
403
+ await api.close_connection()
410
404
  await self.disconnect(server, client)
411
405
 
412
- server, smile, client = await self.connect_wrapper(raise_timeout=True)
413
- await self.device_test(
414
- smile, "2020-03-22 00:00:01", testdata, skip_testing=True
415
- )
406
+ server, api, client = await self.connect_wrapper(raise_timeout=True)
407
+ await self.device_test(api, "2020-03-22 00:00:01", testdata, skip_testing=True)
416
408
  result = await self.tinker_thermostat(
417
- smile,
409
+ api,
418
410
  "009490cc2f674ce6b576863fbb64f867",
419
411
  good_schedules=["Weekschema"],
420
412
  unhappy=True,
421
413
  )
422
414
  assert result
423
415
  switch_change = await self.tinker_switch(
424
- smile, "aa6b0002df0a46e1b1eb94beb61eddfe", unhappy=True
416
+ api, "aa6b0002df0a46e1b1eb94beb61eddfe", unhappy=True
425
417
  )
426
418
  assert switch_change
427
- await smile.close_connection()
419
+ await api.close_connection()
428
420
  await self.disconnect(server, client)
429
421
 
430
422
  @pytest.mark.asyncio
@@ -433,19 +425,19 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
433
425
  self.smile_setup = "adam_jip"
434
426
 
435
427
  testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup)
436
- server, smile, client = await self.connect_wrapper()
437
-
438
- await self.device_test(smile, "2021-06-20 00:00:01", testdata)
439
- assert smile.gateway_id == "b5c2386c6f6342669e50fe49dd05b188"
440
- assert smile._last_active["d58fec52899f4f1c92e4f8fad6d8c48c"] is None
441
- assert smile._last_active["06aecb3d00354375924f50c47af36bd2"] is None
442
- assert smile._last_active["d27aede973b54be484f6842d1b2802ad"] is None
443
- assert smile._last_active["13228dab8ce04617af318a2888b3c548"] is None
428
+ server, api, client = await self.connect_wrapper()
429
+
430
+ await self.device_test(api, "2021-06-20 00:00:01", testdata)
431
+ assert api.gateway_id == "b5c2386c6f6342669e50fe49dd05b188"
432
+ assert api._last_active["d58fec52899f4f1c92e4f8fad6d8c48c"] is None
433
+ assert api._last_active["06aecb3d00354375924f50c47af36bd2"] is None
434
+ assert api._last_active["d27aede973b54be484f6842d1b2802ad"] is None
435
+ assert api._last_active["13228dab8ce04617af318a2888b3c548"] is None
444
436
  assert self.entity_items == 245
445
437
 
446
438
  # Negative test
447
439
  result = await self.tinker_thermostat(
448
- smile,
440
+ api,
449
441
  "13228dab8ce04617af318a2888b3c548",
450
442
  schedule_on=False,
451
443
  good_schedules=[None],
@@ -453,11 +445,11 @@ class TestPlugwiseAdam(TestPlugwise): # pylint: disable=attribute-defined-outsi
453
445
  assert result
454
446
 
455
447
  result = await self.tinker_thermostat_schedule(
456
- smile,
448
+ api,
457
449
  "13228dab8ce04617af318a2888b3c548",
458
450
  "off",
459
451
  good_schedules=[None],
460
452
  )
461
453
  assert result
462
- await smile.close_connection()
454
+ await api.close_connection()
463
455
  await self.disconnect(server, client)