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

## Ongoing

- Resolve depreciated use of accessing `hass.components.persistent_notification`.

## v0.52.1

- Downstream the latest Core Plugwise updates.
Expand Down
5 changes: 3 additions & 2 deletions custom_components/plugwise/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
BinarySensorEntity,
BinarySensorEntityDescription,
)
import homeassistant.components.persistent_notification as pn # pw-beta Plugwise notifications
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
Expand Down Expand Up @@ -169,8 +170,8 @@ def is_on(self) -> bool:
# pw-beta: show Plugwise notifications as HA persistent notifications
if self._notification:
for notify_id, message in self._notification.items():
self.hass.components.persistent_notification.async_create(
message, "Plugwise Notification:", f"{DOMAIN}.{notify_id}"
pn.async_create(
self.hass, message, "Plugwise Notification:", f"{DOMAIN}.{notify_id}"
)

# return self.device["binary_sensors"][self.entity_description.key] # type: ignore [literal-required]
Expand Down