mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Migrate Slimproto to new entity naming style (#74910)
This commit is contained in:
parent
6f28e4bfee
commit
cdab725bf4
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user