diff --git a/homeassistant/components/xbox/binary_sensor.py b/homeassistant/components/xbox/binary_sensor.py index 592909f3aac..7cf7ca6a6a5 100644 --- a/homeassistant/components/xbox/binary_sensor.py +++ b/homeassistant/components/xbox/binary_sensor.py @@ -6,10 +6,8 @@ from functools import partial from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant, callback +from homeassistant.helpers import entity_registry as er from homeassistant.helpers.entity_platform import AddEntitiesCallback -from homeassistant.helpers.entity_registry import ( - async_get_registry as async_get_entity_registry, -) from . import XboxUpdateCoordinator from .base_sensor import XboxBaseSensorEntity @@ -80,7 +78,7 @@ async def async_remove_entities( current: dict[str, XboxBinarySensorEntity], ) -> None: """Remove friend sensors from Home Assistant.""" - registry = await async_get_entity_registry(coordinator.hass) + registry = er.async_get(coordinator.hass) entities = current[xuid] for entity in entities: if entity.entity_id in registry.entities: diff --git a/homeassistant/components/xbox/sensor.py b/homeassistant/components/xbox/sensor.py index edcc4a8c135..02b4f8b84a4 100644 --- a/homeassistant/components/xbox/sensor.py +++ b/homeassistant/components/xbox/sensor.py @@ -6,10 +6,8 @@ from functools import partial from homeassistant.components.sensor import SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant, callback +from homeassistant.helpers import entity_registry as er from homeassistant.helpers.entity_platform import AddEntitiesCallback -from homeassistant.helpers.entity_registry import ( - async_get_registry as async_get_entity_registry, -) from . import XboxUpdateCoordinator from .base_sensor import XboxBaseSensorEntity @@ -82,7 +80,7 @@ async def async_remove_entities( current: dict[str, XboxSensorEntity], ) -> None: """Remove friend sensors from Home Assistant.""" - registry = await async_get_entity_registry(coordinator.hass) + registry = er.async_get(coordinator.hass) entities = current[xuid] for entity in entities: if entity.entity_id in registry.entities: