Use shorthand attributes in Universal (#100219)
This commit is contained in:
parent
6485320bc4
commit
6545fba549
1 changed files with 1 additions and 7 deletions
|
@ -40,7 +40,6 @@ from homeassistant.components.media_player import (
|
||||||
SERVICE_PLAY_MEDIA,
|
SERVICE_PLAY_MEDIA,
|
||||||
SERVICE_SELECT_SOUND_MODE,
|
SERVICE_SELECT_SOUND_MODE,
|
||||||
SERVICE_SELECT_SOURCE,
|
SERVICE_SELECT_SOURCE,
|
||||||
MediaPlayerDeviceClass,
|
|
||||||
MediaPlayerEntity,
|
MediaPlayerEntity,
|
||||||
MediaPlayerEntityFeature,
|
MediaPlayerEntityFeature,
|
||||||
MediaPlayerState,
|
MediaPlayerState,
|
||||||
|
@ -177,7 +176,7 @@ class UniversalMediaPlayer(MediaPlayerEntity):
|
||||||
self._child_state = None
|
self._child_state = None
|
||||||
self._state_template_result = None
|
self._state_template_result = None
|
||||||
self._state_template = config.get(CONF_STATE_TEMPLATE)
|
self._state_template = config.get(CONF_STATE_TEMPLATE)
|
||||||
self._device_class = config.get(CONF_DEVICE_CLASS)
|
self._attr_device_class = config.get(CONF_DEVICE_CLASS)
|
||||||
self._attr_unique_id = config.get(CONF_UNIQUE_ID)
|
self._attr_unique_id = config.get(CONF_UNIQUE_ID)
|
||||||
self._browse_media_entity = config.get(CONF_BROWSE_MEDIA_ENTITY)
|
self._browse_media_entity = config.get(CONF_BROWSE_MEDIA_ENTITY)
|
||||||
|
|
||||||
|
@ -294,11 +293,6 @@ class UniversalMediaPlayer(MediaPlayerEntity):
|
||||||
DOMAIN, service_name, service_data, blocking=True, context=self._context
|
DOMAIN, service_name, service_data, blocking=True, context=self._context
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
|
||||||
def device_class(self) -> MediaPlayerDeviceClass | None:
|
|
||||||
"""Return the class of this device."""
|
|
||||||
return self._device_class
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def master_state(self):
|
def master_state(self):
|
||||||
"""Return the master state for entity or None."""
|
"""Return the master state for entity or None."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue