Skip to content

Commit 7093646

Browse files
authored
Merge pull request #951 from plugwise/pw-1.9.0
Add support for Anna P1
2 parents 5702b15 + 5237d05 commit 7093646

File tree

11 files changed

+1670
-120
lines changed

11 files changed

+1670
-120
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.60.0
6+
7+
- New Feature: add support for Anna P1 via plugwise [v1.9.0](https://github.com/plugwise/python-plugwise/releases/tag/v1.9.0)
8+
59
## v0.59.0
610

711
- New Feature: use RestoreState in climate to save schedule en regulation status, also via plugwise [v1.8.3](https://github.com/plugwise/python-plugwise/releases/tag/v1.8.3)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ Our [Changelog](CHANGELOG.MD) is available as a [separate file](CHANGELOG.md) in
5353
### What do we support (in short)?
5454

5555
- Thermostats
56-
- Adam (firmware 2.x and 3.x) and the accompanying Anna, Jip's, Lisa's, Tom's, Floor's and Plugs (Koen via a Plug). From v0.55.0 zones with one or more thermostats are represented as a single and separate climate-entity in HA.
57-
- Anna (firmware 1.x, 3.x and 4.x)
56+
- Adam (firmware 2.x and 3.x) and the accompanying Anna, Emma's, Jip's, Lisa's, Tom's, Floor's and Plugs (Koen via a Plug). From v0.55.0 zones with one or more thermostats are represented as a single and separate climate-entity in HA.
57+
- Anna (firmware 1.x, 3.x and 4.x) and Anna P1 (4.x)
5858
- Notifications for both types
5959
- Power-related
6060
- Smile P1 (firmware 2.x, 3.x and 4.x)

custom_components/plugwise/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"integration_type": "hub",
88
"iot_class": "local_polling",
99
"loggers": ["plugwise"],
10-
"requirements": ["plugwise==1.8.3"],
11-
"version": "0.59.0",
10+
"requirements": ["plugwise==1.9.0"],
11+
"version": "0.60.0",
1212
"zeroconf": ["_plugwise._tcp.local."]
1313
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "plugwise-beta"
3-
version = "0.59.0"
3+
version = "0.60.0"
44
description = "Plugwise beta custom-component"
55
readme = "README.md"
66
requires-python = ">=3.13"

tests/components/plugwise/conftest.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,34 @@ def mock_smile_anna(chosen_env: str, cooling_present: bool) -> Generator[MagicMo
263263
yield api
264264

265265

266+
@pytest.fixture
267+
def mock_smile_anna_2() -> Generator[MagicMock]:
268+
"""Create a 2nd Mock Anna type for testing."""
269+
chosen_env = "anna_p1"
270+
data = _read_json(chosen_env, "data")
271+
with patch(
272+
"homeassistant.components.plugwise.coordinator.Smile", autospec=True
273+
) as api_mock:
274+
api = api_mock.return_value
275+
276+
api.async_update.return_value = data
277+
api.connect.return_value = Version("4.4.4")
278+
api.cooling_present = False
279+
api.gateway_id = "53130847be2f436cb946b78dedb9053a"
280+
api.heater_id = "36b937e44ad145bab165fa0fe99d742d"
281+
api.reboot = True
282+
api.smile = build_smile(
283+
hostname = "smile98765",
284+
model = "Gateway",
285+
model_id = "smile_thermo",
286+
name = "Smile Anna P1",
287+
type = "thermostat",
288+
version = "4.4.4",
289+
)
290+
291+
yield api
292+
293+
266294
@pytest.fixture
267295
def mock_smile_p1(chosen_env: str, gateway_id: str) -> Generator[MagicMock]:
268296
"""Create a base Mock P1 type for testing with different datasets and gateway-ids."""
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"1e5e55b958ac445583602f767cb45942": {
3+
"active_preset": "home",
4+
"available_schedules": ["Thermostat schedule", "off"],
5+
"climate_mode": "heat",
6+
"control_state": "idle",
7+
"dev_class": "thermostat",
8+
"firmware": "2018-02-08T11:15:53+01:00",
9+
"hardware": "6539-1301-500",
10+
"location": "5b13651d79c4454684fd268850b1bff8",
11+
"model": "ThermoTouch",
12+
"name": "Anna",
13+
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
14+
"select_schedule": "off",
15+
"sensors": {
16+
"illuminance": 2.0,
17+
"setpoint": 19.0,
18+
"temperature": 19.4
19+
},
20+
"temperature_offset": {
21+
"lower_bound": -2.0,
22+
"resolution": 0.1,
23+
"setpoint": 0.0,
24+
"upper_bound": 2.0
25+
},
26+
"thermostat": {
27+
"lower_bound": 4.0,
28+
"resolution": 0.1,
29+
"setpoint": 19.0,
30+
"upper_bound": 30.0
31+
},
32+
"vendor": "Plugwise"
33+
},
34+
"36b937e44ad145bab165fa0fe99d742d": {
35+
"available": true,
36+
"binary_sensors": {
37+
"dhw_state": false,
38+
"flame_state": false,
39+
"heating_state": false
40+
},
41+
"dev_class": "heater_central",
42+
"location": "da7be222ab3b420c927f3e49fade0304",
43+
"model": "Generic heater",
44+
"model_id": "HR24",
45+
"name": "OpenTherm",
46+
"sensors": {
47+
"intended_boiler_temperature": 0.0,
48+
"modulation_level": 0.0,
49+
"water_pressure": 6.0,
50+
"water_temperature": 35.0
51+
},
52+
"switches": {
53+
"dhw_cm_switch": true
54+
},
55+
"vendor": "Intergas"
56+
},
57+
"53130847be2f436cb946b78dedb9053a": {
58+
"binary_sensors": {
59+
"plugwise_notification": false
60+
},
61+
"dev_class": "gateway",
62+
"firmware": "4.4.4",
63+
"hardware": "AME Smile 2.0 board",
64+
"location": "da7be222ab3b420c927f3e49fade0304",
65+
"mac_address": "C493000ABCD",
66+
"model": "Gateway",
67+
"model_id": "smile_thermo",
68+
"name": "Smile Anna P1",
69+
"notifications": {},
70+
"sensors": {
71+
"outdoor_temperature": 11.8
72+
},
73+
"vendor": "Plugwise"
74+
},
75+
"da7be222ab3b420c927f3e49fade0304": {
76+
"available": true,
77+
"dev_class": "smartmeter",
78+
"location": "da7be222ab3b420c927f3e49fade0304",
79+
"model": "2MS212 SMR5.5",
80+
"name": "P1",
81+
"sensors": {
82+
"electricity_consumed_off_peak_cumulative": 618.001,
83+
"electricity_consumed_off_peak_interval": 7,
84+
"electricity_consumed_off_peak_point": 393,
85+
"electricity_consumed_peak_cumulative": 576.014,
86+
"electricity_consumed_peak_interval": 0,
87+
"electricity_consumed_peak_point": 0,
88+
"electricity_phase_one_consumed": 393,
89+
"electricity_phase_one_produced": 0,
90+
"electricity_produced_off_peak_cumulative": 246.504,
91+
"electricity_produced_off_peak_interval": 0,
92+
"electricity_produced_off_peak_point": 0,
93+
"electricity_produced_peak_cumulative": 709.442,
94+
"electricity_produced_peak_interval": 0,
95+
"electricity_produced_peak_point": 0,
96+
"gas_consumed_cumulative": 25.37,
97+
"gas_consumed_interval": 0.01,
98+
"net_electricity_cumulative": 238.069,
99+
"net_electricity_point": 393,
100+
"voltage_phase_one": 234.6
101+
},
102+
"vendor": "SAGEM"
103+
}
104+
}

tests/components/plugwise/fixtures/m_anna_heatpump_idle/data.json

Lines changed: 0 additions & 97 deletions
This file was deleted.

tests/components/plugwise/snapshots/test_climate.ambr

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -658,24 +658,24 @@
658658
'state': 'auto',
659659
})
660660
# ---
661-
# name: test_anna_3_climate_snapshot[platforms0-True-m_anna_heatpump_idle][climate.anna-entry]
661+
# name: test_anna_3_climate_snapshot[platforms0][climate.anna-entry]
662662
EntityRegistryEntrySnapshot({
663663
'aliases': set({
664664
}),
665665
'area_id': None,
666666
'capabilities': dict({
667667
'hvac_modes': list([
668668
<HVACMode.AUTO: 'auto'>,
669-
<HVACMode.HEAT_COOL: 'heat_cool'>,
669+
<HVACMode.HEAT: 'heat'>,
670670
]),
671671
'max_temp': 30.0,
672672
'min_temp': 4.0,
673673
'preset_modes': list([
674-
'no_frost',
675674
'home',
676-
'away',
677675
'asleep',
676+
'away',
678677
'vacation',
678+
'no_frost',
679679
]),
680680
'target_temp_step': 0.1,
681681
}),
@@ -702,43 +702,42 @@
702702
'platform': 'plugwise',
703703
'previous_unique_id': None,
704704
'suggested_object_id': None,
705-
'supported_features': <ClimateEntityFeature: 18>,
705+
'supported_features': <ClimateEntityFeature: 17>,
706706
'translation_key': 'plugwise',
707-
'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-climate',
707+
'unique_id': '1e5e55b958ac445583602f767cb45942-climate',
708708
'unit_of_measurement': None,
709709
})
710710
# ---
711-
# name: test_anna_3_climate_snapshot[platforms0-True-m_anna_heatpump_idle][climate.anna-state]
711+
# name: test_anna_3_climate_snapshot[platforms0][climate.anna-state]
712712
StateSnapshot({
713713
'attributes': ReadOnlyDict({
714-
'current_temperature': 23.0,
714+
'current_temperature': 19.4,
715715
'friendly_name': 'Anna',
716716
'hvac_action': <HVACAction.IDLE: 'idle'>,
717717
'hvac_modes': list([
718718
<HVACMode.AUTO: 'auto'>,
719-
<HVACMode.HEAT_COOL: 'heat_cool'>,
719+
<HVACMode.HEAT: 'heat'>,
720720
]),
721721
'max_temp': 30.0,
722722
'min_temp': 4.0,
723723
'preset_mode': 'home',
724724
'preset_modes': list([
725-
'no_frost',
726725
'home',
727-
'away',
728726
'asleep',
727+
'away',
729728
'vacation',
729+
'no_frost',
730730
]),
731-
'supported_features': <ClimateEntityFeature: 18>,
732-
'target_temp_high': 30.0,
733-
'target_temp_low': 20.5,
731+
'supported_features': <ClimateEntityFeature: 17>,
734732
'target_temp_step': 0.1,
733+
'temperature': 19.0,
735734
}),
736735
'context': <ANY>,
737736
'entity_id': 'climate.anna',
738737
'last_changed': <ANY>,
739738
'last_reported': <ANY>,
740739
'last_updated': <ANY>,
741-
'state': 'auto',
740+
'state': 'heat',
742741
})
743742
# ---
744743
# name: test_anna_climate_snapshot[platforms0-True-anna_heatpump_heating][climate.anna-entry]

0 commit comments

Comments
 (0)