Skip to content

Commit bf2d085

Browse files
authored
Merge pull request #644 from plugwise/pw_0_37_7
Implement plugwise v0.37.7
2 parents 654dba7 + 49c1789 commit bf2d085

File tree

12 files changed

+117
-35
lines changed

12 files changed

+117
-35
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Versions from 0.40 and up
44

5+
## v0.50.3
6+
7+
- Thermostat-schedule (Select) improvements via [plugwise v0.37.7](https://github.com/plugwise/python-plugwise/releases/tag/v0.37.7)
8+
59
## v0.50.2
610

711
- Fix for Core Issue [#117542](https://github.com/home-assistant/core/issues/117542)

custom_components/plugwise/climate.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
LOWER_BOUND,
3737
MASTER_THERMOSTATS,
3838
MODE,
39-
NONE,
4039
REGULATION_MODES,
4140
RESOLUTION,
4241
SELECT_REGULATION_MODE,
@@ -201,7 +200,7 @@ def hvac_modes(self) -> list[HVACMode]:
201200
):
202201
hvac_modes.append(HVACMode.OFF)
203202

204-
if self.device[AVAILABLE_SCHEDULES] != [NONE]:
203+
if AVAILABLE_SCHEDULES in self.device:
205204
hvac_modes.append(HVACMode.AUTO)
206205

207206
if self.cdr_gateway[COOLING_PRESENT]:

custom_components/plugwise/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"integration_type": "hub",
99
"iot_class": "local_polling",
1010
"loggers": ["plugwise"],
11-
"requirements": ["plugwise==0.37.5"],
12-
"version": "0.50.2"
11+
"requirements": ["plugwise==0.37.7"],
12+
"version": "0.50.3"
1313
}

tests/components/plugwise/conftest.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def mock_smile_config_flow() -> Generator[None, MagicMock, None]:
7272
@pytest.fixture
7373
def mock_smile_adam() -> Generator[None, MagicMock, None]:
7474
"""Create a Mock Adam environment for testing exceptions."""
75-
chosen_env = "adam_multiple_devices_per_zone"
75+
chosen_env = "m_adam_multiple_devices_per_zone"
7676

7777
with patch(
7878
"homeassistant.components.plugwise.coordinator.Smile", autospec=True
@@ -316,6 +316,33 @@ def mock_smile_p1_2() -> Generator[None, MagicMock, None]:
316316
yield smile
317317

318318

319+
@pytest.fixture
320+
def mock_smile_legacy_anna() -> Generator[None, MagicMock, None]:
321+
"""Create a Mock legacy Anna environment for testing exceptions."""
322+
chosen_env = "legacy_anna"
323+
with patch(
324+
"homeassistant.components.plugwise.coordinator.Smile", autospec=True
325+
) as smile_mock:
326+
smile = smile_mock.return_value
327+
328+
smile.gateway_id = "0000aaaa0000aaaa0000aaaa0000aa00"
329+
smile.heater_id = "04e4cbfe7f4340f090f85ec3b9e6a950"
330+
smile.smile_version = "1.8.22"
331+
smile.smile_type = "thermostat"
332+
smile.smile_hostname = "smile98765"
333+
smile.smile_model = "Gateway"
334+
smile.smile_name = "Smile Anna"
335+
336+
smile.connect.return_value = True
337+
338+
all_data = _read_json(chosen_env, "all_data")
339+
smile.async_update.return_value = PlugwiseData(
340+
all_data["gateway"], all_data["devices"]
341+
)
342+
343+
yield smile
344+
345+
319346
@pytest.fixture
320347
def mock_stretch() -> Generator[None, MagicMock, None]:
321348
"""Create a Mock Stretch environment for testing exceptions."""
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"devices": {
3+
"0000aaaa0000aaaa0000aaaa0000aa00": {
4+
"dev_class": "gateway",
5+
"firmware": "1.8.22",
6+
"location": "0000aaaa0000aaaa0000aaaa0000aa00",
7+
"mac_address": "01:23:45:67:89:AB",
8+
"model": "Gateway",
9+
"name": "Smile Anna",
10+
"vendor": "Plugwise"
11+
},
12+
"04e4cbfe7f4340f090f85ec3b9e6a950": {
13+
"binary_sensors": {
14+
"flame_state": true,
15+
"heating_state": true
16+
},
17+
"dev_class": "heater_central",
18+
"location": "0000aaaa0000aaaa0000aaaa0000aa00",
19+
"maximum_boiler_temperature": {
20+
"lower_bound": 50.0,
21+
"resolution": 1.0,
22+
"setpoint": 50.0,
23+
"upper_bound": 90.0
24+
},
25+
"model": "4.21",
26+
"name": "OpenTherm",
27+
"sensors": {
28+
"dhw_temperature": 51.2,
29+
"intended_boiler_temperature": 17.0,
30+
"modulation_level": 0.0,
31+
"return_temperature": 21.7,
32+
"water_pressure": 1.2,
33+
"water_temperature": 23.6
34+
},
35+
"vendor": "Bosch Thermotechniek B.V."
36+
},
37+
"0d266432d64443e283b5d708ae98b455": {
38+
"active_preset": "home",
39+
"available_schedules": ["None"],
40+
"dev_class": "thermostat",
41+
"firmware": "2017-03-13T11:54:58+01:00",
42+
"hardware": "6539-1301-500",
43+
"location": "0000aaaa0000aaaa0000aaaa0000aa00",
44+
"mode": "heat",
45+
"model": "ThermoTouch",
46+
"name": "Anna",
47+
"preset_modes": ["away", "vacation", "asleep", "home", "no_frost"],
48+
"select_schedule": "None",
49+
"sensors": {
50+
"illuminance": 151,
51+
"setpoint": 20.5,
52+
"temperature": 20.4
53+
},
54+
"thermostat": {
55+
"lower_bound": 4.0,
56+
"resolution": 0.1,
57+
"setpoint": 20.5,
58+
"upper_bound": 30.0
59+
},
60+
"vendor": "Plugwise"
61+
}
62+
},
63+
"gateway": {
64+
"cooling_present": false,
65+
"gateway_id": "0000aaaa0000aaaa0000aaaa0000aa00",
66+
"heater_id": "04e4cbfe7f4340f090f85ec3b9e6a950",
67+
"item_count": 43,
68+
"smile_name": "Smile Anna"
69+
}
70+
}

tests/components/plugwise/fixtures/m_adam_cooling/all_data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"model": "ThermoTouch",
6767
"name": "Anna",
6868
"preset_modes": ["no_frost", "asleep", "vacation", "home", "away"],
69-
"select_schedule": "None",
69+
"select_schedule": "off",
7070
"sensors": {
7171
"setpoint": 23.5,
7272
"temperature": 25.8

tests/components/plugwise/fixtures/m_adam_heating/all_data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"model": "ThermoTouch",
7272
"name": "Anna",
7373
"preset_modes": ["no_frost", "asleep", "vacation", "home", "away"],
74-
"select_schedule": "None",
74+
"select_schedule": "off",
7575
"sensors": {
7676
"setpoint": 20.0,
7777
"temperature": 19.1

tests/components/plugwise/fixtures/m_adam_jip/all_data.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"1346fbd8498d4dbcab7e18d51b771f3d": {
44
"active_preset": "no_frost",
55
"available": true,
6-
"available_schedules": ["None"],
76
"control_state": "off",
87
"dev_class": "zone_thermostat",
98
"firmware": "2016-10-27T02:00:00+02:00",
@@ -13,7 +12,6 @@
1312
"model": "Lisa",
1413
"name": "Slaapkamer",
1514
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
16-
"select_schedule": "None",
1715
"sensors": {
1816
"battery": 92,
1917
"setpoint": 13.0,
@@ -99,7 +97,6 @@
9997
"6f3e9d7084214c21b9dfa46f6eeb8700": {
10098
"active_preset": "home",
10199
"available": true,
102-
"available_schedules": ["None"],
103100
"control_state": "off",
104101
"dev_class": "zone_thermostat",
105102
"firmware": "2016-10-27T02:00:00+02:00",
@@ -109,7 +106,6 @@
109106
"model": "Lisa",
110107
"name": "Kinderkamer",
111108
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
112-
"select_schedule": "None",
113109
"sensors": {
114110
"battery": 79,
115111
"setpoint": 13.0,
@@ -156,7 +152,6 @@
156152
"a6abc6a129ee499c88a4d420cc413b47": {
157153
"active_preset": "home",
158154
"available": true,
159-
"available_schedules": ["None"],
160155
"control_state": "off",
161156
"dev_class": "zone_thermostat",
162157
"firmware": "2016-10-27T02:00:00+02:00",
@@ -166,7 +161,6 @@
166161
"model": "Lisa",
167162
"name": "Logeerkamer",
168163
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
169-
"select_schedule": "None",
170164
"sensors": {
171165
"battery": 80,
172166
"setpoint": 13.0,
@@ -269,7 +263,6 @@
269263
"f61f1a2535f54f52ad006a3d18e459ca": {
270264
"active_preset": "home",
271265
"available": true,
272-
"available_schedules": ["None"],
273266
"control_state": "off",
274267
"dev_class": "zone_thermometer",
275268
"firmware": "2020-09-01T02:00:00+02:00",
@@ -279,7 +272,6 @@
279272
"model": "Jip",
280273
"name": "Woonkamer",
281274
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
282-
"select_schedule": "None",
283275
"sensors": {
284276
"battery": 100,
285277
"humidity": 56.2,
@@ -306,7 +298,7 @@
306298
"cooling_present": false,
307299
"gateway_id": "b5c2386c6f6342669e50fe49dd05b188",
308300
"heater_id": "e4684553153b44afbef2200885f379dc",
309-
"item_count": 221,
301+
"item_count": 213,
310302
"notifications": {},
311303
"smile_name": "Adam"
312304
}

tests/components/plugwise/fixtures/adam_multiple_devices_per_zone/all_data.json renamed to tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,6 @@
371371
"e7693eb9582644e5b865dba8d4447cf1": {
372372
"active_preset": "no_frost",
373373
"available": true,
374-
"available_schedules": [
375-
"CV Roan",
376-
"Bios Schema met Film Avond",
377-
"GF7 Woonkamer",
378-
"Badkamer Schema",
379-
"CV Jessie",
380-
"off"
381-
],
382374
"dev_class": "thermostatic_radiator_valve",
383375
"firmware": "2019-03-27T01:00:00+01:00",
384376
"hardware": "1",
@@ -387,7 +379,6 @@
387379
"model": "Tom/Floor",
388380
"name": "CV Kraan Garage",
389381
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
390-
"select_schedule": "off",
391382
"sensors": {
392383
"battery": 68,
393384
"setpoint": 5.5,

tests/components/plugwise/snapshots/test_diagnostics.ambr

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,6 @@
391391
'e7693eb9582644e5b865dba8d4447cf1': dict({
392392
'active_preset': 'no_frost',
393393
'available': True,
394-
'available_schedules': list([
395-
'**REDACTED_0**',
396-
'**REDACTED_1**',
397-
'**REDACTED_2**',
398-
'**REDACTED_3**',
399-
'**REDACTED_4**',
400-
'off',
401-
]),
402394
'dev_class': 'thermostatic_radiator_valve',
403395
'firmware': '2019-03-27T01:00:00+01:00',
404396
'hardware': '1',
@@ -413,7 +405,6 @@
413405
'vacation',
414406
'no_frost',
415407
]),
416-
'select_schedule': 'off',
417408
'sensors': dict({
418409
'battery': 68,
419410
'setpoint': 5.5,

0 commit comments

Comments
 (0)