Skip to content

Commit

Permalink
Remove snapcast friendly_name attribute (#93116)
Browse files Browse the repository at this point in the history
Remove friendly_name attribute and fix names
  • Loading branch information
luar123 committed May 15, 2023
1 parent b38a7aa commit 209650d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions homeassistant/components/snapcast/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def unique_id(self):
@property
def name(self):
"""Return the name of the device."""
return f"{GROUP_PREFIX}{self._group.identifier}"
return f"{self._group.friendly_name} {GROUP_SUFFIX}"

@property
def source(self):
Expand All @@ -197,12 +197,6 @@ def source_list(self):
"""List of available input sources."""
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:
"""Set input source."""
streams = self._group.streams_by_name()
Expand Down Expand Up @@ -270,7 +264,7 @@ def identifier(self):
@property
def name(self):
"""Return the name of the device."""
return f"{CLIENT_PREFIX}{self._client.identifier}"
return f"{self._client.friendly_name} {CLIENT_SUFFIX}"

@property
def source(self):
Expand Down Expand Up @@ -307,8 +301,6 @@ def extra_state_attributes(self):
state_attrs = {}
if self.latency is not None:
state_attrs["latency"] = self.latency
name = f"{self._client.friendly_name} {CLIENT_SUFFIX}"
state_attrs["friendly_name"] = name
return state_attrs

@property
Expand Down

0 comments on commit 209650d

Please sign in to comment.