Migrate Songpal to has entity name (#96753)

This commit is contained in:
Joost Lekkerkerker 2023-07-18 12:38:17 +02:00 committed by GitHub
parent faa67a40c4
commit c253549e68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,6 +100,8 @@ class SongpalEntity(MediaPlayerEntity):
| MediaPlayerEntityFeature.TURN_ON
| MediaPlayerEntityFeature.TURN_OFF
)
_attr_has_entity_name = True
_attr_name = None
def __init__(self, name, device):
"""Init."""
@ -197,11 +199,6 @@ class SongpalEntity(MediaPlayerEntity):
self.hass.loop.create_task(self._dev.listen_notifications())
@property
def name(self):
"""Return name of the device."""
return self._name
@property
def unique_id(self):
"""Return a unique ID."""
@ -220,7 +217,7 @@ class SongpalEntity(MediaPlayerEntity):
identifiers={(DOMAIN, self.unique_id)},
manufacturer="Sony Corporation",
model=self._model,
name=self.name,
name=self._name,
sw_version=self._sysinfo.version,
)