Cleanup deprecated async_get_registry in plex (#72077)

pull/72087/head
epenet 2022-05-18 14:09:25 +02:00 committed by GitHub
parent df13fcd1a5
commit 64b0dd1e7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -20,6 +20,7 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_IDLE, STATE_PAUSED, STATE_PLAYING from homeassistant.const import STATE_IDLE, STATE_PAUSED, STATE_PLAYING
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.device_registry import DeviceEntryType from homeassistant.helpers.device_registry import DeviceEntryType
from homeassistant.helpers.dispatcher import ( from homeassistant.helpers.dispatcher import (
async_dispatcher_connect, async_dispatcher_connect,
@ -27,7 +28,6 @@ from homeassistant.helpers.dispatcher import (
) )
from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.entity_registry import async_get_registry
from homeassistant.helpers.network import is_internal_request from homeassistant.helpers.network import is_internal_request
from .const import ( from .const import (
@ -76,7 +76,7 @@ async def async_setup_entry(
) -> None: ) -> None:
"""Set up Plex media_player from a config entry.""" """Set up Plex media_player from a config entry."""
server_id = config_entry.data[CONF_SERVER_IDENTIFIER] server_id = config_entry.data[CONF_SERVER_IDENTIFIER]
registry = await async_get_registry(hass) registry = er.async_get(hass)
@callback @callback
def async_new_media_players(new_entities): def async_new_media_players(new_entities):