Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Versions from 0.40 and up

## v0.60.0

- New Feature: add support for Anna P1 via plugwise [v1.9.0](https://github.com/plugwise/python-plugwise/releases/tag/v1.9.0)

## v0.59.0

- 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)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ Our [Changelog](CHANGELOG.MD) is available as a [separate file](CHANGELOG.md) in
### What do we support (in short)?

- Thermostats
- 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.
- Anna (firmware 1.x, 3.x and 4.x)
- 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.
- Anna (firmware 1.x, 3.x and 4.x) and Anna P1 (4.x)
- Notifications for both types
- Power-related
- Smile P1 (firmware 2.x, 3.x and 4.x)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plugwise/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"integration_type": "hub",
"iot_class": "local_polling",
"loggers": ["plugwise"],
"requirements": ["plugwise==1.8.3"],
"version": "0.59.0",
"requirements": ["plugwise==1.9.0"],
"version": "0.60.0",
"zeroconf": ["_plugwise._tcp.local."]
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "plugwise-beta"
version = "0.59.0"
version = "0.60.0"
description = "Plugwise beta custom-component"
readme = "README.md"
requires-python = ">=3.13"
Expand Down
28 changes: 28 additions & 0 deletions tests/components/plugwise/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,34 @@ def mock_smile_anna(chosen_env: str, cooling_present: bool) -> Generator[MagicMo
yield api


@pytest.fixture
def mock_smile_anna_2() -> Generator[MagicMock]:
"""Create a 2nd Mock Anna type for testing."""
chosen_env = "anna_p1"
data = _read_json(chosen_env, "data")
with patch(
"homeassistant.components.plugwise.coordinator.Smile", autospec=True
) as api_mock:
api = api_mock.return_value

api.async_update.return_value = data
api.connect.return_value = Version("4.4.4")
api.cooling_present = False
api.gateway_id = "53130847be2f436cb946b78dedb9053a"
api.heater_id = "36b937e44ad145bab165fa0fe99d742d"
api.reboot = True
api.smile = build_smile(
hostname = "smile98765",
model = "Gateway",
model_id = "smile_thermo",
name = "Smile Anna P1",
type = "thermostat",
version = "4.4.4",
)

yield api


@pytest.fixture
def mock_smile_p1(chosen_env: str, gateway_id: str) -> Generator[MagicMock]:
"""Create a base Mock P1 type for testing with different datasets and gateway-ids."""
Expand Down
104 changes: 104 additions & 0 deletions tests/components/plugwise/fixtures/anna_p1/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"1e5e55b958ac445583602f767cb45942": {
"active_preset": "home",
"available_schedules": ["Thermostat schedule", "off"],
"climate_mode": "heat",
"control_state": "idle",
"dev_class": "thermostat",
"firmware": "2018-02-08T11:15:53+01:00",
"hardware": "6539-1301-500",
"location": "5b13651d79c4454684fd268850b1bff8",
"model": "ThermoTouch",
"name": "Anna",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"select_schedule": "off",
"sensors": {
"illuminance": 2.0,
"setpoint": 19.0,
"temperature": 19.4
},
"temperature_offset": {
"lower_bound": -2.0,
"resolution": 0.1,
"setpoint": 0.0,
"upper_bound": 2.0
},
"thermostat": {
"lower_bound": 4.0,
"resolution": 0.1,
"setpoint": 19.0,
"upper_bound": 30.0
},
"vendor": "Plugwise"
},
"36b937e44ad145bab165fa0fe99d742d": {
"available": true,
"binary_sensors": {
"dhw_state": false,
"flame_state": false,
"heating_state": false
},
"dev_class": "heater_central",
"location": "da7be222ab3b420c927f3e49fade0304",
"model": "Generic heater",
"model_id": "HR24",
"name": "OpenTherm",
"sensors": {
"intended_boiler_temperature": 0.0,
"modulation_level": 0.0,
"water_pressure": 6.0,
"water_temperature": 35.0
},
"switches": {
"dhw_cm_switch": true
},
"vendor": "Intergas"
},
"53130847be2f436cb946b78dedb9053a": {
"binary_sensors": {
"plugwise_notification": false
},
"dev_class": "gateway",
"firmware": "4.4.4",
"hardware": "AME Smile 2.0 board",
"location": "da7be222ab3b420c927f3e49fade0304",
"mac_address": "C493000ABCD",
"model": "Gateway",
"model_id": "smile_thermo",
"name": "Smile Anna P1",
"notifications": {},
"sensors": {
"outdoor_temperature": 11.8
},
"vendor": "Plugwise"
},
"da7be222ab3b420c927f3e49fade0304": {
"available": true,
"dev_class": "smartmeter",
"location": "da7be222ab3b420c927f3e49fade0304",
"model": "2MS212 SMR5.5",
"name": "P1",
"sensors": {
"electricity_consumed_off_peak_cumulative": 618.001,
"electricity_consumed_off_peak_interval": 7,
"electricity_consumed_off_peak_point": 393,
"electricity_consumed_peak_cumulative": 576.014,
"electricity_consumed_peak_interval": 0,
"electricity_consumed_peak_point": 0,
"electricity_phase_one_consumed": 393,
"electricity_phase_one_produced": 0,
"electricity_produced_off_peak_cumulative": 246.504,
"electricity_produced_off_peak_interval": 0,
"electricity_produced_off_peak_point": 0,
"electricity_produced_peak_cumulative": 709.442,
"electricity_produced_peak_interval": 0,
"electricity_produced_peak_point": 0,
"gas_consumed_cumulative": 25.37,
"gas_consumed_interval": 0.01,
"net_electricity_cumulative": 238.069,
"net_electricity_point": 393,
"voltage_phase_one": 234.6
},
"vendor": "SAGEM"
}
}

This file was deleted.

29 changes: 14 additions & 15 deletions tests/components/plugwise/snapshots/test_climate.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -658,24 +658,24 @@
'state': 'auto',
})
# ---
# name: test_anna_3_climate_snapshot[platforms0-True-m_anna_heatpump_idle][climate.anna-entry]
# name: test_anna_3_climate_snapshot[platforms0][climate.anna-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'hvac_modes': list([
<HVACMode.AUTO: 'auto'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.HEAT: 'heat'>,
]),
'max_temp': 30.0,
'min_temp': 4.0,
'preset_modes': list([
'no_frost',
'home',
'away',
'asleep',
'away',
'vacation',
'no_frost',
]),
'target_temp_step': 0.1,
}),
Expand All @@ -702,43 +702,42 @@
'platform': 'plugwise',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 18>,
'supported_features': <ClimateEntityFeature: 17>,
'translation_key': 'plugwise',
'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-climate',
'unique_id': '1e5e55b958ac445583602f767cb45942-climate',
'unit_of_measurement': None,
})
# ---
# name: test_anna_3_climate_snapshot[platforms0-True-m_anna_heatpump_idle][climate.anna-state]
# name: test_anna_3_climate_snapshot[platforms0][climate.anna-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': 23.0,
'current_temperature': 19.4,
'friendly_name': 'Anna',
'hvac_action': <HVACAction.IDLE: 'idle'>,
'hvac_modes': list([
<HVACMode.AUTO: 'auto'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.HEAT: 'heat'>,
]),
'max_temp': 30.0,
'min_temp': 4.0,
'preset_mode': 'home',
'preset_modes': list([
'no_frost',
'home',
'away',
'asleep',
'away',
'vacation',
'no_frost',
]),
'supported_features': <ClimateEntityFeature: 18>,
'target_temp_high': 30.0,
'target_temp_low': 20.5,
'supported_features': <ClimateEntityFeature: 17>,
'target_temp_step': 0.1,
'temperature': 19.0,
}),
'context': <ANY>,
'entity_id': 'climate.anna',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'auto',
'state': 'heat',
})
# ---
# name: test_anna_climate_snapshot[platforms0-True-anna_heatpump_heating][climate.anna-entry]
Expand Down
Loading
Loading