Add alias to DOMAIN import (part 4) (#125563)
* Add alias to DOMAIN import (part 4)
* Simplify
* More integration
* Apply suggestions from code review
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Revert "Apply suggestions from code review"
This reverts commit 07471d3629
.
---------
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
pull/125242/head^2
parent
ded34561b1
commit
e750f8f457
|
@ -21,7 +21,7 @@ from homeassistant.components.light import (
|
|||
VALID_TRANSITION,
|
||||
is_on,
|
||||
)
|
||||
from homeassistant.components.switch import DOMAIN, SwitchEntity
|
||||
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN, SwitchEntity
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID,
|
||||
CONF_BRIGHTNESS,
|
||||
|
@ -178,7 +178,7 @@ async def async_setup_platform(
|
|||
await flux.async_flux_update()
|
||||
|
||||
service_name = slugify(f"{name} update")
|
||||
hass.services.async_register(DOMAIN, service_name, async_update)
|
||||
hass.services.async_register(SWITCH_DOMAIN, service_name, async_update)
|
||||
|
||||
|
||||
class FluxSwitch(SwitchEntity, RestoreEntity):
|
||||
|
|
|
@ -13,7 +13,7 @@ from pyheos import HeosError, const as heos_const
|
|||
from homeassistant.components import media_source
|
||||
from homeassistant.components.media_player import (
|
||||
ATTR_MEDIA_ENQUEUE,
|
||||
DOMAIN,
|
||||
DOMAIN as MEDIA_PLAYER_DOMAIN,
|
||||
BrowseMedia,
|
||||
MediaPlayerEnqueue,
|
||||
MediaPlayerEntity,
|
||||
|
@ -83,7 +83,7 @@ async def async_setup_entry(
|
|||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
"""Add media players for a config entry."""
|
||||
players = hass.data[HEOS_DOMAIN][DOMAIN]
|
||||
players = hass.data[HEOS_DOMAIN][MEDIA_PLAYER_DOMAIN]
|
||||
devices = [HeosMediaPlayer(player) for player in players.values()]
|
||||
async_add_entities(devices, True)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
|||
from iaqualink.device import AqualinkBinarySensor
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DOMAIN,
|
||||
DOMAIN as BINARY_SENSOR_DOMAIN,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
|
@ -26,7 +26,10 @@ async def async_setup_entry(
|
|||
) -> None:
|
||||
"""Set up discovered binary sensors."""
|
||||
async_add_entities(
|
||||
(HassAqualinkBinarySensor(dev) for dev in hass.data[AQUALINK_DOMAIN][DOMAIN]),
|
||||
(
|
||||
HassAqualinkBinarySensor(dev)
|
||||
for dev in hass.data[AQUALINK_DOMAIN][BINARY_SENSOR_DOMAIN]
|
||||
),
|
||||
True,
|
||||
)
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ from iaqualink.device import AqualinkLight
|
|||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
ATTR_EFFECT,
|
||||
DOMAIN,
|
||||
DOMAIN as LIGHT_DOMAIN,
|
||||
ColorMode,
|
||||
LightEntity,
|
||||
LightEntityFeature,
|
||||
|
@ -32,7 +32,8 @@ async def async_setup_entry(
|
|||
) -> None:
|
||||
"""Set up discovered lights."""
|
||||
async_add_entities(
|
||||
(HassAqualinkLight(dev) for dev in hass.data[AQUALINK_DOMAIN][DOMAIN]), True
|
||||
(HassAqualinkLight(dev) for dev in hass.data[AQUALINK_DOMAIN][LIGHT_DOMAIN]),
|
||||
True,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,11 @@ from __future__ import annotations
|
|||
|
||||
from iaqualink.device import AqualinkSensor
|
||||
|
||||
from homeassistant.components.sensor import DOMAIN, SensorDeviceClass, SensorEntity
|
||||
from homeassistant.components.sensor import (
|
||||
DOMAIN as SENSOR_DOMAIN,
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import UnitOfTemperature
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -23,7 +27,8 @@ async def async_setup_entry(
|
|||
) -> None:
|
||||
"""Set up discovered sensors."""
|
||||
async_add_entities(
|
||||
(HassAqualinkSensor(dev) for dev in hass.data[AQUALINK_DOMAIN][DOMAIN]), True
|
||||
(HassAqualinkSensor(dev) for dev in hass.data[AQUALINK_DOMAIN][SENSOR_DOMAIN]),
|
||||
True,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from typing import Any
|
|||
|
||||
from iaqualink.device import AqualinkSwitch
|
||||
|
||||
from homeassistant.components.switch import DOMAIN, SwitchEntity
|
||||
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN, SwitchEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -25,7 +25,8 @@ async def async_setup_entry(
|
|||
) -> None:
|
||||
"""Set up discovered switches."""
|
||||
async_add_entities(
|
||||
(HassAqualinkSwitch(dev) for dev in hass.data[AQUALINK_DOMAIN][DOMAIN]), True
|
||||
(HassAqualinkSwitch(dev) for dev in hass.data[AQUALINK_DOMAIN][SWITCH_DOMAIN]),
|
||||
True,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from typing import Any
|
|||
from homeassistant.components.cover import (
|
||||
ATTR_POSITION,
|
||||
ATTR_TILT_POSITION,
|
||||
DOMAIN,
|
||||
DOMAIN as COVER_DOMAIN,
|
||||
CoverDeviceClass,
|
||||
CoverEntity,
|
||||
CoverEntityFeature,
|
||||
|
@ -122,7 +122,7 @@ async def async_setup_entry(
|
|||
"""
|
||||
data = config_entry.runtime_data
|
||||
bridge = data.bridge
|
||||
cover_devices = bridge.get_devices_by_domain(DOMAIN)
|
||||
cover_devices = bridge.get_devices_by_domain(COVER_DOMAIN)
|
||||
async_add_entities(
|
||||
# default to standard LutronCasetaCover type if the pylutron type is not yet mapped
|
||||
PYLUTRON_TYPE_TO_CLASSES.get(cover_device["type"], LutronCasetaShade)(
|
||||
|
|
|
@ -6,7 +6,11 @@ from typing import Any
|
|||
|
||||
from pylutron_caseta import FAN_HIGH, FAN_LOW, FAN_MEDIUM, FAN_MEDIUM_HIGH, FAN_OFF
|
||||
|
||||
from homeassistant.components.fan import DOMAIN, FanEntity, FanEntityFeature
|
||||
from homeassistant.components.fan import (
|
||||
DOMAIN as FAN_DOMAIN,
|
||||
FanEntity,
|
||||
FanEntityFeature,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.util.percentage import (
|
||||
|
@ -33,7 +37,7 @@ async def async_setup_entry(
|
|||
"""
|
||||
data = config_entry.runtime_data
|
||||
bridge = data.bridge
|
||||
fan_devices = bridge.get_devices_by_domain(DOMAIN)
|
||||
fan_devices = bridge.get_devices_by_domain(FAN_DOMAIN)
|
||||
async_add_entities(LutronCasetaFan(fan_device, data) for fan_device in fan_devices)
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ from homeassistant.components.light import (
|
|||
ATTR_HS_COLOR,
|
||||
ATTR_TRANSITION,
|
||||
ATTR_WHITE,
|
||||
DOMAIN,
|
||||
DOMAIN as LIGHT_DOMAIN,
|
||||
ColorMode,
|
||||
LightEntity,
|
||||
LightEntityFeature,
|
||||
|
@ -62,7 +62,7 @@ async def async_setup_entry(
|
|||
"""
|
||||
data = config_entry.runtime_data
|
||||
bridge = data.bridge
|
||||
light_devices = bridge.get_devices_by_domain(DOMAIN)
|
||||
light_devices = bridge.get_devices_by_domain(LIGHT_DOMAIN)
|
||||
async_add_entities(
|
||||
LutronCasetaLight(light_device, data) for light_device in light_devices
|
||||
)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.components.switch import DOMAIN, SwitchEntity
|
||||
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN, SwitchEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -22,7 +22,7 @@ async def async_setup_entry(
|
|||
"""
|
||||
data = config_entry.runtime_data
|
||||
bridge = data.bridge
|
||||
switch_devices = bridge.get_devices_by_domain(DOMAIN)
|
||||
switch_devices = bridge.get_devices_by_domain(SWITCH_DOMAIN)
|
||||
async_add_entities(
|
||||
LutronCasetaLight(switch_device, data) for switch_device in switch_devices
|
||||
)
|
||||
|
|
|
@ -5,7 +5,10 @@ from __future__ import annotations
|
|||
from http import HTTPStatus
|
||||
import logging
|
||||
|
||||
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorEntity
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DOMAIN as BINARY_SENSOR_DOMAIN,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.components.http import KEY_HASS, HomeAssistantView
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -55,7 +58,7 @@ class MyStromView(HomeAssistantView):
|
|||
)
|
||||
|
||||
button_id = data[button_action]
|
||||
entity_id = f"{DOMAIN}.{button_id}_{button_action}"
|
||||
entity_id = f"{BINARY_SENSOR_DOMAIN}.{button_id}_{button_action}"
|
||||
if entity_id not in self.buttons:
|
||||
_LOGGER.info(
|
||||
"New myStrom button/action detected: %s/%s", button_id, button_action
|
||||
|
|
|
@ -6,7 +6,7 @@ from collections.abc import Callable
|
|||
import logging
|
||||
|
||||
from homeassistant.components.alarm_control_panel import (
|
||||
DOMAIN,
|
||||
DOMAIN as ALARM_CONTROL_PANEL_DOMAIN,
|
||||
AlarmControlPanelEntity,
|
||||
AlarmControlPanelEntityFeature,
|
||||
)
|
||||
|
@ -47,7 +47,9 @@ async def async_setup_entry(
|
|||
async_add_entities([MinutPointAlarmControl(client, home_id)], True)
|
||||
|
||||
async_dispatcher_connect(
|
||||
hass, POINT_DISCOVERY_NEW.format(DOMAIN, POINT_DOMAIN), async_discover_home
|
||||
hass,
|
||||
POINT_DISCOVERY_NEW.format(ALARM_CONTROL_PANEL_DOMAIN, POINT_DOMAIN),
|
||||
async_discover_home,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import logging
|
|||
from pypoint import EVENTS
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DOMAIN,
|
||||
DOMAIN as BINARY_SENSOR_DOMAIN,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
|
@ -60,7 +60,9 @@ async def async_setup_entry(
|
|||
)
|
||||
|
||||
async_dispatcher_connect(
|
||||
hass, POINT_DISCOVERY_NEW.format(DOMAIN, POINT_DOMAIN), async_discover_sensor
|
||||
hass,
|
||||
POINT_DISCOVERY_NEW.format(BINARY_SENSOR_DOMAIN, POINT_DOMAIN),
|
||||
async_discover_sensor,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
|||
import logging
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
DOMAIN,
|
||||
DOMAIN as SENSOR_DOMAIN,
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
SensorEntityDescription,
|
||||
|
@ -64,7 +64,9 @@ async def async_setup_entry(
|
|||
)
|
||||
|
||||
async_dispatcher_connect(
|
||||
hass, POINT_DISCOVERY_NEW.format(DOMAIN, POINT_DOMAIN), async_discover_sensor
|
||||
hass,
|
||||
POINT_DISCOVERY_NEW.format(SENSOR_DOMAIN, POINT_DOMAIN),
|
||||
async_discover_sensor,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components import webhook
|
||||
from homeassistant.components.camera import (
|
||||
DOMAIN,
|
||||
DOMAIN as CAMERA_DOMAIN,
|
||||
PLATFORM_SCHEMA as CAMERA_PLATFORM_SCHEMA,
|
||||
STATE_IDLE,
|
||||
Camera,
|
||||
|
@ -121,7 +121,7 @@ class PushCamera(Camera):
|
|||
|
||||
try:
|
||||
webhook.async_register(
|
||||
self.hass, DOMAIN, self.name, self.webhook_id, handle_webhook
|
||||
self.hass, CAMERA_DOMAIN, self.name, self.webhook_id, handle_webhook
|
||||
)
|
||||
except ValueError:
|
||||
_LOGGER.error(
|
||||
|
|
|
@ -9,7 +9,7 @@ from screenlogicpy.const.msg import CODE
|
|||
from screenlogicpy.device_const.system import EQUIPMENT_FLAG
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DOMAIN,
|
||||
DOMAIN as BINARY_SENSOR_DOMAIN,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
BinarySensorEntityDescription,
|
||||
|
@ -202,7 +202,9 @@ async def async_setup_entry(
|
|||
chem_sensor_description.key,
|
||||
)
|
||||
if EQUIPMENT_FLAG.INTELLICHEM not in gateway.equipment_flags:
|
||||
cleanup_excluded_entity(coordinator, DOMAIN, chem_sensor_data_path)
|
||||
cleanup_excluded_entity(
|
||||
coordinator, BINARY_SENSOR_DOMAIN, chem_sensor_data_path
|
||||
)
|
||||
continue
|
||||
if gateway.get_data(*chem_sensor_data_path):
|
||||
entities.append(
|
||||
|
@ -216,7 +218,9 @@ async def async_setup_entry(
|
|||
scg_sensor_description.key,
|
||||
)
|
||||
if EQUIPMENT_FLAG.CHLORINATOR not in gateway.equipment_flags:
|
||||
cleanup_excluded_entity(coordinator, DOMAIN, scg_sensor_data_path)
|
||||
cleanup_excluded_entity(
|
||||
coordinator, BINARY_SENSOR_DOMAIN, scg_sensor_data_path
|
||||
)
|
||||
continue
|
||||
if gateway.get_data(*scg_sensor_data_path):
|
||||
entities.append(
|
||||
|
|
|
@ -9,7 +9,7 @@ from screenlogicpy.const.msg import CODE
|
|||
from screenlogicpy.device_const.system import EQUIPMENT_FLAG
|
||||
|
||||
from homeassistant.components.number import (
|
||||
DOMAIN,
|
||||
DOMAIN as NUMBER_DOMAIN,
|
||||
NumberEntity,
|
||||
NumberEntityDescription,
|
||||
NumberMode,
|
||||
|
@ -111,7 +111,7 @@ async def async_setup_entry(
|
|||
chem_number_description.key,
|
||||
)
|
||||
if EQUIPMENT_FLAG.INTELLICHEM not in gateway.equipment_flags:
|
||||
cleanup_excluded_entity(coordinator, DOMAIN, chem_number_data_path)
|
||||
cleanup_excluded_entity(coordinator, NUMBER_DOMAIN, chem_number_data_path)
|
||||
continue
|
||||
if gateway.get_data(*chem_number_data_path):
|
||||
entities.append(
|
||||
|
@ -124,7 +124,7 @@ async def async_setup_entry(
|
|||
scg_number_description.key,
|
||||
)
|
||||
if EQUIPMENT_FLAG.CHLORINATOR not in gateway.equipment_flags:
|
||||
cleanup_excluded_entity(coordinator, DOMAIN, scg_number_data_path)
|
||||
cleanup_excluded_entity(coordinator, NUMBER_DOMAIN, scg_number_data_path)
|
||||
continue
|
||||
if gateway.get_data(*scg_number_data_path):
|
||||
entities.append(ScreenLogicSCGNumber(coordinator, scg_number_description))
|
||||
|
|
|
@ -12,7 +12,7 @@ from screenlogicpy.device_const.pump import PUMP_TYPE
|
|||
from screenlogicpy.device_const.system import EQUIPMENT_FLAG
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
DOMAIN,
|
||||
DOMAIN as SENSOR_DOMAIN,
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
SensorEntityDescription,
|
||||
|
@ -267,7 +267,7 @@ async def async_setup_entry(
|
|||
chem_sensor_description.key,
|
||||
)
|
||||
if EQUIPMENT_FLAG.INTELLICHEM not in gateway.equipment_flags:
|
||||
cleanup_excluded_entity(coordinator, DOMAIN, chem_sensor_data_path)
|
||||
cleanup_excluded_entity(coordinator, SENSOR_DOMAIN, chem_sensor_data_path)
|
||||
continue
|
||||
if gateway.get_data(*chem_sensor_data_path):
|
||||
chem_sensor_description = dataclasses.replace(
|
||||
|
@ -282,7 +282,7 @@ async def async_setup_entry(
|
|||
scg_sensor_description.key,
|
||||
)
|
||||
if EQUIPMENT_FLAG.CHLORINATOR not in gateway.equipment_flags:
|
||||
cleanup_excluded_entity(coordinator, DOMAIN, scg_sensor_data_path)
|
||||
cleanup_excluded_entity(coordinator, SENSOR_DOMAIN, scg_sensor_data_path)
|
||||
continue
|
||||
if gateway.get_data(*scg_sensor_data_path):
|
||||
scg_sensor_description = dataclasses.replace(
|
||||
|
|
|
@ -35,7 +35,7 @@ from aiounifi.models.traffic_rule import TrafficRule, TrafficRuleEnableRequest
|
|||
from aiounifi.models.wlan import Wlan, WlanEnableRequest
|
||||
|
||||
from homeassistant.components.switch import (
|
||||
DOMAIN,
|
||||
DOMAIN as SWITCH_DOMAIN,
|
||||
SwitchDeviceClass,
|
||||
SwitchEntity,
|
||||
SwitchEntityDescription,
|
||||
|
@ -88,7 +88,7 @@ def async_dpi_group_device_info_fn(hub: UnifiHub, obj_id: str) -> DeviceInfo:
|
|||
"""Create device registry entry for DPI group."""
|
||||
return DeviceInfo(
|
||||
entry_type=DeviceEntryType.SERVICE,
|
||||
identifiers={(DOMAIN, f"unifi_controller_{obj_id}")},
|
||||
identifiers={(SWITCH_DOMAIN, f"unifi_controller_{obj_id}")},
|
||||
manufacturer=ATTR_MANUFACTURER,
|
||||
model="UniFi Network",
|
||||
name="UniFi Network",
|
||||
|
@ -102,7 +102,7 @@ def async_unifi_network_device_info_fn(hub: UnifiHub, obj_id: str) -> DeviceInfo
|
|||
assert unique_id is not None
|
||||
return DeviceInfo(
|
||||
entry_type=DeviceEntryType.SERVICE,
|
||||
identifiers={(DOMAIN, unique_id)},
|
||||
identifiers={(SWITCH_DOMAIN, unique_id)},
|
||||
manufacturer=ATTR_MANUFACTURER,
|
||||
model="UniFi Network",
|
||||
name="UniFi Network",
|
||||
|
@ -307,12 +307,14 @@ def async_update_unique_id(hass: HomeAssistant, config_entry: UnifiConfigEntry)
|
|||
def update_unique_id(obj_id: str, type_name: str) -> None:
|
||||
"""Rework unique ID."""
|
||||
new_unique_id = f"{type_name}-{obj_id}"
|
||||
if ent_reg.async_get_entity_id(DOMAIN, UNIFI_DOMAIN, new_unique_id):
|
||||
if ent_reg.async_get_entity_id(SWITCH_DOMAIN, UNIFI_DOMAIN, new_unique_id):
|
||||
return
|
||||
|
||||
prefix, _, suffix = obj_id.partition("_")
|
||||
unique_id = f"{prefix}-{type_name}-{suffix}"
|
||||
if entity_id := ent_reg.async_get_entity_id(DOMAIN, UNIFI_DOMAIN, unique_id):
|
||||
if entity_id := ent_reg.async_get_entity_id(
|
||||
SWITCH_DOMAIN, UNIFI_DOMAIN, unique_id
|
||||
):
|
||||
ent_reg.async_update_entity(entity_id, new_unique_id=new_unique_id)
|
||||
|
||||
for obj_id in hub.api.outlets:
|
||||
|
|
|
@ -35,7 +35,7 @@ from homeassistant.components.media_player import (
|
|||
ATTR_SOUND_MODE,
|
||||
ATTR_SOUND_MODE_LIST,
|
||||
DEVICE_CLASSES_SCHEMA,
|
||||
DOMAIN,
|
||||
DOMAIN as MEDIA_PLAYER_DOMAIN,
|
||||
PLATFORM_SCHEMA as MEDIA_PLAYER_PLATFORM_SCHEMA,
|
||||
SERVICE_CLEAR_PLAYLIST,
|
||||
SERVICE_PLAY_MEDIA,
|
||||
|
@ -292,7 +292,11 @@ class UniversalMediaPlayer(MediaPlayerEntity):
|
|||
service_data[ATTR_ENTITY_ID] = active_child.entity_id
|
||||
|
||||
await self.hass.services.async_call(
|
||||
DOMAIN, service_name, service_data, blocking=True, context=self._context
|
||||
MEDIA_PLAYER_DOMAIN,
|
||||
service_name,
|
||||
service_data,
|
||||
blocking=True,
|
||||
context=self._context,
|
||||
)
|
||||
|
||||
@property
|
||||
|
@ -651,7 +655,9 @@ class UniversalMediaPlayer(MediaPlayerEntity):
|
|||
entity_id = self._browse_media_entity
|
||||
if not entity_id and self._child_state:
|
||||
entity_id = self._child_state.entity_id
|
||||
component: EntityComponent[MediaPlayerEntity] = self.hass.data[DOMAIN]
|
||||
component: EntityComponent[MediaPlayerEntity] = self.hass.data[
|
||||
MEDIA_PLAYER_DOMAIN
|
||||
]
|
||||
if entity_id and (entity := component.get_entity(entity_id)):
|
||||
return await entity.async_browse_media(media_content_type, media_content_id)
|
||||
raise NotImplementedError
|
||||
|
|
Loading…
Reference in New Issue