Skip to content
Closed
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
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

Versions from 0.40 and up

## Ongoing
## v0.62.0

- 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)
- Block Plugwise switch-groups, use HA group-helper instead, via PR [#978](https://github.com/plugwise/plugwise-beta/pull/978)
- 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
Expand Down
1 change: 1 addition & 0 deletions custom_components/plugwise/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
RELAY: Final = "relay"
COOLING_ENA_SWITCH: Final ="cooling_ena_switch"
SWITCHES: Final = "switches"
SWITCH_GROUPS: Final[tuple[str, str]] = ("report", "switching")

# Default directives
DEFAULT_PORT: Final[int] = 80
Expand Down
2 changes: 1 addition & 1 deletion custom_components/plugwise/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"iot_class": "local_polling",
"loggers": ["plugwise"],
"requirements": ["plugwise==1.11.0"],
"version": "0.61.0",
"version": "0.62.0",
"zeroconf": ["_plugwise._tcp.local."]
}
5 changes: 5 additions & 0 deletions custom_components/plugwise/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback

from .const import (
DEV_CLASS,
DHW_SETPOINT,
DHW_TEMP,
EL_CONS_INTERVAL,
Expand Down Expand Up @@ -66,6 +67,7 @@
OUTDOOR_TEMP,
RETURN_TEMP,
SENSORS,
SWITCH_GROUPS,
TARGET_TEMP,
TARGET_TEMP_HIGH,
TARGET_TEMP_LOW,
Expand Down Expand Up @@ -453,7 +455,7 @@
)


async def async_setup_entry(

Check failure on line 458 in custom_components/plugwise/sensor.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=plugwise_plugwise-beta&issues=AZrLc5RoEhWv3-CNqerb&open=AZrLc5RoEhWv3-CNqerb&pullRequest=978
hass: HomeAssistant,
entry: PlugwiseConfigEntry,
async_add_entities: AddConfigEntryEntitiesCallback,
Expand Down Expand Up @@ -482,6 +484,9 @@
device = coordinator.data[device_id]
if not (sensors := device.get(SENSORS)):
continue
# block switch-groups, user HA group helper instead
if device.get(DEV_CLASS) in SWITCH_GROUPS:
continue
for description in PLUGWISE_SENSORS:
if description.key not in sensors:
continue
Expand Down
5 changes: 5 additions & 0 deletions custom_components/plugwise/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

from .const import (
COOLING_ENA_SWITCH,
DEV_CLASS,
DHW_CM_SWITCH,
LOCK,
LOGGER, # pw-beta
MEMBERS,
RELAY,
SWITCH_GROUPS,
SWITCHES,
)

Expand Down Expand Up @@ -69,7 +71,7 @@
)


async def async_setup_entry(

Check failure on line 74 in custom_components/plugwise/switch.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=plugwise_plugwise-beta&issues=AZrLc5PGEhWv3-CNqera&open=AZrLc5PGEhWv3-CNqera&pullRequest=978
hass: HomeAssistant,
entry: PlugwiseConfigEntry,
async_add_entities: AddConfigEntryEntitiesCallback,
Expand Down Expand Up @@ -97,6 +99,9 @@
device = coordinator.data[device_id]
if not (switches := device.get(SWITCHES)):
continue
# block switch-groups, user HA group helper instead
if device.get(DEV_CLASS) in SWITCH_GROUPS:
continue
for description in PLUGWISE_SWITCHES:
if description.key not in switches:
continue
Expand Down
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.61.0"
version = "0.62.0"
description = "Plugwise beta custom-component"
readme = "README.md"
requires-python = ">=3.13"
Expand Down
112 changes: 0 additions & 112 deletions tests/components/plugwise/snapshots/test_sensor.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -1216,118 +1216,6 @@
'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': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_electricity_consumed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
'sensor': dict({
'suggested_display_precision': 0,
}),
}),
'original_device_class': <SensorDeviceClass.POWER: 'power'>,
'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': <UnitOfPower.WATT: 'W'>,
})
# ---
# 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': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_electricity_consumed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'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': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_electricity_produced',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
'sensor': dict({
'suggested_display_precision': 0,
}),
}),
'original_device_class': <SensorDeviceClass.POWER: 'power'>,
'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': <UnitOfPower.WATT: 'W'>,
})
# ---
# 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': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_electricity_produced',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '0.0',
})
# ---
# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.tom_badkamer_battery-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
Expand Down
147 changes: 0 additions & 147 deletions tests/components/plugwise/snapshots/test_switch.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -440,55 +440,6 @@
'state': 'on',
})
# ---
# name: test_adam_switch_snapshot[platforms0][switch.test_relay-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.test_relay',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <SwitchDeviceClass.SWITCH: 'switch'>,
'original_icon': None,
'original_name': 'Relay',
'platform': 'plugwise',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'relay',
'unique_id': 'e8ef2a01ed3b4139a53bf749204fe6b4-relay',
'unit_of_measurement': None,
})
# ---
# name: test_adam_switch_snapshot[platforms0][switch.test_relay-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'switch',
'friendly_name': 'Test Relay',
}),
'context': <ANY>,
'entity_id': 'switch.test_relay',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_adam_switch_snapshot[platforms0][switch.usg_smart_plug_lock-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
Expand Down Expand Up @@ -979,104 +930,6 @@
'state': 'on',
})
# ---
# name: test_stretch_switch_snapshot[platforms0][switch.schakel_relay-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.schakel_relay',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <SwitchDeviceClass.SWITCH: 'switch'>,
'original_icon': None,
'original_name': 'Relay',
'platform': 'plugwise',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'relay',
'unique_id': 'd03738edfcc947f7b8f4573571d90d2d-relay',
'unit_of_measurement': None,
})
# ---
# name: test_stretch_switch_snapshot[platforms0][switch.schakel_relay-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'switch',
'friendly_name': 'Schakel Relay',
}),
'context': <ANY>,
'entity_id': 'switch.schakel_relay',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_stretch_switch_snapshot[platforms0][switch.stroomvreters_relay-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.stroomvreters_relay',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <SwitchDeviceClass.SWITCH: 'switch'>,
'original_icon': None,
'original_name': 'Relay',
'platform': 'plugwise',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'relay',
'unique_id': 'd950b314e9d8499f968e6db8d82ef78c-relay',
'unit_of_measurement': None,
})
# ---
# name: test_stretch_switch_snapshot[platforms0][switch.stroomvreters_relay-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'switch',
'friendly_name': 'Stroomvreters Relay',
}),
'context': <ANY>,
'entity_id': 'switch.stroomvreters_relay',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_stretch_switch_snapshot[platforms0][switch.vaatwasser_2a1ab_lock-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
Expand Down
Loading
Loading