Migrate AppleTV to use has entity name (#96563)

* Migrate AppleTV to use has entity name

* Add comma
This commit is contained in:
Joost Lekkerkerker 2023-07-15 03:31:56 +02:00 committed by GitHub
parent 38630f7898
commit a27e126c86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,14 +88,18 @@ class AppleTVEntity(Entity):
"""Device that sends commands to an Apple TV."""
_attr_should_poll = False
_attr_has_entity_name = True
_attr_name = None
def __init__(self, name, identifier, manager):
"""Initialize device."""
self.atv = None
self.manager = manager
self._attr_name = name
self._attr_unique_id = identifier
self._attr_device_info = DeviceInfo(identifiers={(DOMAIN, identifier)})
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, identifier)},
name=name,
)
async def async_added_to_hass(self):
"""Handle when an entity is about to be added to Home Assistant."""