mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 08:07:45 +00:00
Migrate Songpal to has entity name (#96753)
This commit is contained in:
parent
faa67a40c4
commit
c253549e68
@ -100,6 +100,8 @@ class SongpalEntity(MediaPlayerEntity):
|
|||||||
| MediaPlayerEntityFeature.TURN_ON
|
| MediaPlayerEntityFeature.TURN_ON
|
||||||
| MediaPlayerEntityFeature.TURN_OFF
|
| MediaPlayerEntityFeature.TURN_OFF
|
||||||
)
|
)
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
_attr_name = None
|
||||||
|
|
||||||
def __init__(self, name, device):
|
def __init__(self, name, device):
|
||||||
"""Init."""
|
"""Init."""
|
||||||
@ -197,11 +199,6 @@ class SongpalEntity(MediaPlayerEntity):
|
|||||||
|
|
||||||
self.hass.loop.create_task(self._dev.listen_notifications())
|
self.hass.loop.create_task(self._dev.listen_notifications())
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""Return name of the device."""
|
|
||||||
return self._name
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
"""Return a unique ID."""
|
"""Return a unique ID."""
|
||||||
@ -220,7 +217,7 @@ class SongpalEntity(MediaPlayerEntity):
|
|||||||
identifiers={(DOMAIN, self.unique_id)},
|
identifiers={(DOMAIN, self.unique_id)},
|
||||||
manufacturer="Sony Corporation",
|
manufacturer="Sony Corporation",
|
||||||
model=self._model,
|
model=self._model,
|
||||||
name=self.name,
|
name=self._name,
|
||||||
sw_version=self._sysinfo.version,
|
sw_version=self._sysinfo.version,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user