Migrate Slimproto to new entity naming style (#74910)

pull/74929/head
Franck Nijhof 2022-07-10 22:18:15 +02:00 committed by GitHub
parent 6f28e4bfee
commit cdab725bf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -74,6 +74,7 @@ async def async_setup_entry(
class SlimProtoPlayer(MediaPlayerEntity):
"""Representation of MediaPlayerEntity from SlimProto Player."""
_attr_has_entity_name = True
_attr_should_poll = False
_attr_supported_features = (
MediaPlayerEntityFeature.PAUSE
@ -139,7 +140,6 @@ class SlimProtoPlayer(MediaPlayerEntity):
@callback
def update_attributes(self) -> None:
"""Handle player updates."""
self._attr_name = self.player.name
self._attr_volume_level = self.player.volume_level / 100
self._attr_media_position = self.player.elapsed_seconds
self._attr_media_position_updated_at = utcnow()