Skip to content

Commit

Permalink
replace deprecated async_get_registry method
Browse files Browse the repository at this point in the history
  • Loading branch information
Aohzan committed Apr 27, 2023
1 parent dc892ca commit 423e146
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 0.6.0

- Replace deprecated async_get_registry method

## 0.5.0

- Add missing async_write_ha_state for number entity
Expand Down
4 changes: 2 additions & 2 deletions custom_components/rfplayer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
)
from homeassistant.core import CoreState, callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.device_registry import async_get_registry
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.restore_state import RestoreEntity

Expand Down Expand Up @@ -359,7 +359,7 @@ async def async_added_to_hass(self):
async def async_will_remove_from_hass(self):
"""Clean when entity removed."""
await super().async_will_remove_from_hass()
device_registry = await async_get_registry(self.hass)
device_registry = dr.async_get(hass)
device = device_registry.async_get_device(
(DOMAIN, self.hass.data[DOMAIN]
[CONF_DEVICE] + "_" + self._attr_unique_id)
Expand Down

0 comments on commit 423e146

Please sign in to comment.