Migrate Monoprice to has entity name (#96704)

This commit is contained in:
Joost Lekkerkerker 2023-07-17 09:09:53 +02:00 committed by GitHub
parent 9496b651a8
commit 13140830a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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."""
@ -137,12 +139,11 @@ class MonopriceZone(MediaPlayerEntity):
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