Use shorthand attributes in Universal (#100219)

This commit is contained in:
Joost Lekkerkerker 2023-09-12 17:34:41 +02:00 committed by GitHub
parent 6485320bc4
commit 6545fba549
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,6 @@ from homeassistant.components.media_player import (
SERVICE_PLAY_MEDIA,
SERVICE_SELECT_SOUND_MODE,
SERVICE_SELECT_SOURCE,
MediaPlayerDeviceClass,
MediaPlayerEntity,
MediaPlayerEntityFeature,
MediaPlayerState,
@ -177,7 +176,7 @@ class UniversalMediaPlayer(MediaPlayerEntity):
self._child_state = None
self._state_template_result = None
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._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
)
@property
def device_class(self) -> MediaPlayerDeviceClass | None:
"""Return the class of this device."""
return self._device_class
@property
def master_state(self):
"""Return the master state for entity or None."""