Migrate VLC Telnet to has entity naming (#96774)

* Migrate VLC Telnet to has entity naming

* Remove unused variable
pull/96807/head
Joost Lekkerkerker 2023-07-17 17:47:47 +02:00 committed by GitHub
parent 70c88a125c
commit 560e0cc7e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -70,6 +70,8 @@ def catch_vlc_errors(
class VlcDevice(MediaPlayerEntity): class VlcDevice(MediaPlayerEntity):
"""Representation of a vlc player.""" """Representation of a vlc player."""
_attr_has_entity_name = True
_attr_name = None
_attr_media_content_type = MediaType.MUSIC _attr_media_content_type = MediaType.MUSIC
_attr_supported_features = ( _attr_supported_features = (
MediaPlayerEntityFeature.CLEAR_PLAYLIST MediaPlayerEntityFeature.CLEAR_PLAYLIST
@ -91,7 +93,6 @@ class VlcDevice(MediaPlayerEntity):
) -> None: ) -> None:
"""Initialize the vlc device.""" """Initialize the vlc device."""
self._config_entry = config_entry self._config_entry = config_entry
self._name = name
self._volume: float | None = None self._volume: float | None = None
self._muted: bool | None = None self._muted: bool | None = None
self._media_position_updated_at: datetime | None = None self._media_position_updated_at: datetime | None = None
@ -183,11 +184,6 @@ class VlcDevice(MediaPlayerEntity):
if self._media_title and (pos := self._media_title.find("?authSig=")) != -1: if self._media_title and (pos := self._media_title.find("?authSig=")) != -1:
self._media_title = self._media_title[:pos] self._media_title = self._media_title[:pos]
@property
def name(self) -> str:
"""Return the name of the device."""
return self._name
@property @property
def available(self) -> bool: def available(self) -> bool:
"""Return True if entity is available.""" """Return True if entity is available."""