Skip to content

Commit

Permalink
Migrate Monoprice to has entity name (#96704)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek committed Jul 17, 2023
1 parent 9496b65 commit 1314083
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions homeassistant/components/monoprice/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ class MonopriceZone(MediaPlayerEntity):
| MediaPlayerEntityFeature.TURN_OFF
| MediaPlayerEntityFeature.SELECT_SOURCE
)
_attr_has_entity_name = True
_attr_name = None

def __init__(self, monoprice, sources, namespace, zone_id):
"""Initialize new zone."""
Expand All @@ -137,12 +139,11 @@ def __init__(self, monoprice, sources, namespace, zone_id):
self._attr_source_list = sources[2]
self._zone_id = zone_id
self._attr_unique_id = f"{namespace}_{self._zone_id}"
self._attr_name = f"Zone {self._zone_id}"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, self._attr_unique_id)},
manufacturer="Monoprice",
model="6-Zone Amplifier",
name=self.name,
name=f"Zone {self._zone_id}",
)

self._snapshot = None
Expand Down

0 comments on commit 1314083

Please sign in to comment.