Migrate Volumio to has entity naming (#96822)

pull/96836/head
Joost Lekkerkerker 2023-07-18 12:17:41 +02:00 committed by GitHub
parent b9f92b526b
commit 5f0e5b7e0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -49,6 +49,8 @@ async def async_setup_entry(
class Volumio(MediaPlayerEntity):
"""Volumio Player Object."""
_attr_has_entity_name = True
_attr_name = None
_attr_media_content_type = MediaType.MUSIC
_attr_supported_features = (
MediaPlayerEntityFeature.PAUSE
@ -89,11 +91,6 @@ class Volumio(MediaPlayerEntity):
"""Return the unique id for the entity."""
return self._uid
@property
def name(self):
"""Return the name of the entity."""
return self._name
@property
def device_info(self) -> DeviceInfo:
"""Return device info for this device."""
@ -101,7 +98,7 @@ class Volumio(MediaPlayerEntity):
identifiers={(DOMAIN, self.unique_id)},
manufacturer="Volumio",
model=self._info["hardware"],
name=self.name,
name=self._name,
sw_version=self._info["systemversion"],
)