diff --git a/CHANGELOG.md b/CHANGELOG.md index 76cffbf67..9dc6cbf0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,14 @@ Versions from 0.40 and up ## Ongoing +- Extended feature: extent/improve Plugwise groups, via PR[#976](https://github.com/plugwise/plugwise-beta/pull/976) and plugwise [v1.11.0](https://github.com/plugwise/python-plugwise/releases/tag/v1.11.0) - DeviceInfo: show configuration_url on gateway only, via PR [#975](https://github.com/plugwise/plugwise-beta/pull/975) ## v0.61.0 - Final revisit of diagnostics category assignments as accepted in Core Plugwise, via PR [#965](https://github.com/plugwise/plugwise-beta/pull/965) - Revisit diagnostics category assignments based on [#810](https://github.com/plugwise/python-plugwise/issues/810) via PR [#952](https://github.com/plugwise/plugwise-beta/pull/952) -- New feature: implement setting Adam zone profile via PR [#958](https://github.com/plugwise/plugwise-beta/pull/958) +- New feature: implement setting Adam zone profile via PR [#958](https://github.com/plugwise/plugwise-beta/pull/958) and plugwise [v1.10.0](https://github.com/plugwise/python-plugwise/releases/tag/v1.10.0) - Implement translation for added homeassistantError raise message via PR [#948](https://github.com/plugwise/plugwise-beta/pull/948) - Line up strings with Core Plugwise strings via PR [#954](https://github.com/plugwise/plugwise-beta/pull/954) diff --git a/custom_components/plugwise/manifest.json b/custom_components/plugwise/manifest.json index d396d880f..5e9ac079e 100644 --- a/custom_components/plugwise/manifest.json +++ b/custom_components/plugwise/manifest.json @@ -7,7 +7,7 @@ "integration_type": "hub", "iot_class": "local_polling", "loggers": ["plugwise"], - "requirements": ["plugwise==1.10.0"], + "requirements": ["plugwise==1.11.0"], "version": "0.61.0", "zeroconf": ["_plugwise._tcp.local."] } diff --git a/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json b/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json index ee4ecd743..afa38abd8 100644 --- a/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json +++ b/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json @@ -181,6 +181,21 @@ }, "vendor": "Plugwise" }, + "c9293d1d68ee48fc8843c6f0dee2b6be": { + "dev_class": "pumping", + "members": [ + "854f8a9b0e7e425db97f1f110e1ce4b3", + "ad4838d7d35c4d6ea796ee12ae5aedf8" + ], + "model": "Group", + "name": "Vloerverwarming", + "sensors": { + "electricity_consumed": 45.0, + "electricity_produced": 0.0, + "temperature": 20.1 + }, + "vendor": "Plugwise" + }, "da224107914542988a88561b4452b0f6": { "binary_sensors": { "plugwise_notification": false @@ -257,8 +272,12 @@ "2568cc4b9c1e401495d4741a5f89bee1", "29542b2b6a6a4169acecc15c72a599b8" ], - "model": "Switchgroup", + "model": "Group", "name": "Test", + "sensors": { + "electricity_consumed": 16.5, + "electricity_produced": 0.0 + }, "switches": { "relay": true }, diff --git a/tests/components/plugwise/fixtures/m_adam_cooling/data.json b/tests/components/plugwise/fixtures/m_adam_cooling/data.json index fdd52b1ef..9b95475eb 100644 --- a/tests/components/plugwise/fixtures/m_adam_cooling/data.json +++ b/tests/components/plugwise/fixtures/m_adam_cooling/data.json @@ -91,6 +91,21 @@ }, "vendor": "Plugwise" }, + "c9293d1d68ee48fc8843c6f0dee2b6be": { + "dev_class": "pumping", + "members": [ + "854f8a9b0e7e425db97f1f110e1ce4b3", + "ad4838d7d35c4d6ea796ee12ae5aedf8" + ], + "model": "Group", + "name": "Vloerverwarming", + "sensors": { + "electricity_consumed": 45.0, + "electricity_produced": 0.0, + "temperature": 20.1 + }, + "vendor": "Plugwise" + }, "da224107914542988a88561b4452b0f6": { "binary_sensors": { "plugwise_notification": false @@ -173,8 +188,12 @@ "2568cc4b9c1e401495d4741a5f89bee1", "29542b2b6a6a4169acecc15c72a599b8" ], - "model": "Switchgroup", + "model": "Group", "name": "Test", + "sensors": { + "electricity_consumed": 16.5, + "electricity_produced": 0.0 + }, "switches": { "relay": true }, diff --git a/tests/components/plugwise/fixtures/m_adam_heating/data.json b/tests/components/plugwise/fixtures/m_adam_heating/data.json index 2f3951c0c..47a8fdeb2 100644 --- a/tests/components/plugwise/fixtures/m_adam_heating/data.json +++ b/tests/components/plugwise/fixtures/m_adam_heating/data.json @@ -96,6 +96,21 @@ }, "vendor": "Plugwise" }, + "c9293d1d68ee48fc8843c6f0dee2b6be": { + "dev_class": "pumping", + "members": [ + "854f8a9b0e7e425db97f1f110e1ce4b3", + "ad4838d7d35c4d6ea796ee12ae5aedf8" + ], + "model": "Group", + "name": "Vloerverwarming", + "sensors": { + "electricity_consumed": 45.0, + "electricity_produced": 0.0, + "temperature": 20.1 + }, + "vendor": "Plugwise" + }, "da224107914542988a88561b4452b0f6": { "binary_sensors": { "plugwise_notification": false @@ -172,8 +187,12 @@ "2568cc4b9c1e401495d4741a5f89bee1", "29542b2b6a6a4169acecc15c72a599b8" ], - "model": "Switchgroup", + "model": "Group", "name": "Test", + "sensors": { + "electricity_consumed": 16.5, + "electricity_produced": 0.0 + }, "switches": { "relay": true }, diff --git a/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/data.json b/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/data.json index f1880ba69..126031795 100644 --- a/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/data.json +++ b/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/data.json @@ -505,6 +505,20 @@ "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A06" }, + "e117db6848394c8cb70d9c28e63d92d2": { + "dev_class": "pumping", + "members": [ + "78d1126fc4c743db81b61c20e88342a7", + "b59bcebaf94b499ea7d46e4a66fb62d8" + ], + "model": "Group", + "name": "Vloerverwarming Woonkamer", + "sensors": { + "electricity_consumed": 35.6, + "temperature": 20.9 + }, + "vendor": "Plugwise" + }, "e7693eb9582644e5b865dba8d4447cf1": { "available": true, "binary_sensors": { @@ -539,8 +553,12 @@ "02cf28bfec924855854c544690a609ef", "4a810418d5394b3f82727340b91ba740" ], - "model": "Switchgroup", + "model": "Group", "name": "Test", + "sensors": { + "electricity_consumed": 14.8, + "electricity_produced": 0.0 + }, "switches": { "relay": true }, diff --git a/tests/components/plugwise/fixtures/stretch_v31/data.json b/tests/components/plugwise/fixtures/stretch_v31/data.json index 250839d08..9927b5c13 100644 --- a/tests/components/plugwise/fixtures/stretch_v31/data.json +++ b/tests/components/plugwise/fixtures/stretch_v31/data.json @@ -91,7 +91,7 @@ "059e4d03c7a34d278add5c7a4a781d19", "cfe95cf3de1948c0b8955125bf754614" ], - "model": "Switchgroup", + "model": "Group", "name": "Schakel", "switches": { "relay": true @@ -107,7 +107,7 @@ "cfe95cf3de1948c0b8955125bf754614", "e1c884e7dede431dadee09506ec4f859" ], - "model": "Switchgroup", + "model": "Group", "name": "Stroomvreters", "switches": { "relay": true diff --git a/tests/components/plugwise/snapshots/test_diagnostics.ambr b/tests/components/plugwise/snapshots/test_diagnostics.ambr index 91411c323..9fe059681 100644 --- a/tests/components/plugwise/snapshots/test_diagnostics.ambr +++ b/tests/components/plugwise/snapshots/test_diagnostics.ambr @@ -554,6 +554,20 @@ 'vendor': 'Plugwise', 'zigbee_mac_address': 'ABCD012345670A06', }), + 'e117db6848394c8cb70d9c28e63d92d2': dict({ + 'dev_class': 'pumping', + 'members': list([ + '78d1126fc4c743db81b61c20e88342a7', + 'b59bcebaf94b499ea7d46e4a66fb62d8', + ]), + 'model': 'Group', + 'name': 'Vloerverwarming Woonkamer', + 'sensors': dict({ + 'electricity_consumed': 35.6, + 'temperature': 20.9, + }), + 'vendor': 'Plugwise', + }), 'e7693eb9582644e5b865dba8d4447cf1': dict({ 'available': True, 'binary_sensors': dict({ @@ -588,8 +602,12 @@ '02cf28bfec924855854c544690a609ef', '4a810418d5394b3f82727340b91ba740', ]), - 'model': 'Switchgroup', + 'model': 'Group', 'name': 'Test', + 'sensors': dict({ + 'electricity_consumed': 14.8, + 'electricity_produced': 0.0, + }), 'switches': dict({ 'relay': True, }), diff --git a/tests/components/plugwise/snapshots/test_sensor.ambr b/tests/components/plugwise/snapshots/test_sensor.ambr index 7c7715dfd..113fba03b 100644 --- a/tests/components/plugwise/snapshots/test_sensor.ambr +++ b/tests/components/plugwise/snapshots/test_sensor.ambr @@ -1216,6 +1216,118 @@ 'state': '37.0', }) # --- +# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.test_electricity_consumed-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.test_electricity_consumed', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Electricity consumed', + 'platform': 'plugwise', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'electricity_consumed', + 'unique_id': 'e8ef2a01ed3b4139a53bf749204fe6b4-electricity_consumed', + 'unit_of_measurement': , + }) +# --- +# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.test_electricity_consumed-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'power', + 'friendly_name': 'Test Electricity consumed', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.test_electricity_consumed', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '16.5', + }) +# --- +# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.test_electricity_produced-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.test_electricity_produced', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Electricity produced', + 'platform': 'plugwise', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'electricity_produced', + 'unique_id': 'e8ef2a01ed3b4139a53bf749204fe6b4-electricity_produced', + 'unit_of_measurement': , + }) +# --- +# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.test_electricity_produced-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'power', + 'friendly_name': 'Test Electricity produced', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.test_electricity_produced', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- # name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.tom_badkamer_battery-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -1489,6 +1601,174 @@ 'state': '100.0', }) # --- +# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.vloerverwarming_electricity_consumed-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.vloerverwarming_electricity_consumed', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Electricity consumed', + 'platform': 'plugwise', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'electricity_consumed', + 'unique_id': 'c9293d1d68ee48fc8843c6f0dee2b6be-electricity_consumed', + 'unit_of_measurement': , + }) +# --- +# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.vloerverwarming_electricity_consumed-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'power', + 'friendly_name': 'Vloerverwarming Electricity consumed', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.vloerverwarming_electricity_consumed', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '45.0', + }) +# --- +# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.vloerverwarming_electricity_produced-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.vloerverwarming_electricity_produced', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Electricity produced', + 'platform': 'plugwise', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'electricity_produced', + 'unique_id': 'c9293d1d68ee48fc8843c6f0dee2b6be-electricity_produced', + 'unit_of_measurement': , + }) +# --- +# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.vloerverwarming_electricity_produced-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'power', + 'friendly_name': 'Vloerverwarming Electricity produced', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.vloerverwarming_electricity_produced', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- +# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.vloerverwarming_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.vloerverwarming_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Temperature', + 'platform': 'plugwise', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'c9293d1d68ee48fc8843c6f0dee2b6be-temperature', + 'unit_of_measurement': , + }) +# --- +# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.vloerverwarming_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Vloerverwarming Temperature', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.vloerverwarming_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '20.1', + }) +# --- # name: test_anna_p1_sensor_snapshot[platforms0][sensor.anna_illuminance-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ diff --git a/tests/components/plugwise/test_init.py b/tests/components/plugwise/test_init.py index 4a4d69368..8800929cb 100644 --- a/tests/components/plugwise/test_init.py +++ b/tests/components/plugwise/test_init.py @@ -297,11 +297,11 @@ async def test_update_device( assert ( len(er.async_entries_for_config_entry(entity_registry, mock_config_entry.entry_id)) - == 51 + == 56 ) assert ( len(dr.async_entries_for_config_entry(device_registry, mock_config_entry.entry_id)) - == 10 + == 11 ) # Add a 2nd Tom/Floor @@ -321,11 +321,11 @@ async def test_update_device( assert ( len(er.async_entries_for_config_entry(entity_registry, mock_config_entry.entry_id)) - == 58 + == 63 ) assert ( len(dr.async_entries_for_config_entry(device_registry, mock_config_entry.entry_id)) - == 11 + == 12 ) item_list: list[str] = [] for device_entry in device_registry.devices.values(): @@ -348,11 +348,11 @@ async def test_update_device( assert ( len(er.async_entries_for_config_entry(entity_registry, mock_config_entry.entry_id)) - == 51 + == 56 ) assert ( len(dr.async_entries_for_config_entry(device_registry, mock_config_entry.entry_id)) - == 10 + == 11 ) item_list: list[str] = [] for device_entry in device_registry.devices.values():