mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Remove snapcast friendly_name attribute (#93116)
Remove friendly_name attribute and fix names
This commit is contained in:
parent
b38a7aabe9
commit
209650dca1
@ -175,7 +175,7 @@ class SnapcastGroupDevice(MediaPlayerEntity):
|
|||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the device."""
|
"""Return the name of the device."""
|
||||||
return f"{GROUP_PREFIX}{self._group.identifier}"
|
return f"{self._group.friendly_name} {GROUP_SUFFIX}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source(self):
|
def source(self):
|
||||||
@ -197,12 +197,6 @@ class SnapcastGroupDevice(MediaPlayerEntity):
|
|||||||
"""List of available input sources."""
|
"""List of available input sources."""
|
||||||
return list(self._group.streams_by_name().keys())
|
return list(self._group.streams_by_name().keys())
|
||||||
|
|
||||||
@property
|
|
||||||
def extra_state_attributes(self):
|
|
||||||
"""Return the state attributes."""
|
|
||||||
name = f"{self._group.friendly_name} {GROUP_SUFFIX}"
|
|
||||||
return {"friendly_name": name}
|
|
||||||
|
|
||||||
async def async_select_source(self, source: str) -> None:
|
async def async_select_source(self, source: str) -> None:
|
||||||
"""Set input source."""
|
"""Set input source."""
|
||||||
streams = self._group.streams_by_name()
|
streams = self._group.streams_by_name()
|
||||||
@ -270,7 +264,7 @@ class SnapcastClientDevice(MediaPlayerEntity):
|
|||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the device."""
|
"""Return the name of the device."""
|
||||||
return f"{CLIENT_PREFIX}{self._client.identifier}"
|
return f"{self._client.friendly_name} {CLIENT_SUFFIX}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source(self):
|
def source(self):
|
||||||
@ -307,8 +301,6 @@ class SnapcastClientDevice(MediaPlayerEntity):
|
|||||||
state_attrs = {}
|
state_attrs = {}
|
||||||
if self.latency is not None:
|
if self.latency is not None:
|
||||||
state_attrs["latency"] = self.latency
|
state_attrs["latency"] = self.latency
|
||||||
name = f"{self._client.friendly_name} {CLIENT_SUFFIX}"
|
|
||||||
state_attrs["friendly_name"] = name
|
|
||||||
return state_attrs
|
return state_attrs
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user