Add has entity name to Blink (#96322)

This commit is contained in:
Joost Lekkerkerker 2023-07-11 20:12:16 +02:00 committed by GitHub
parent b106ca7983
commit 7d2559e6a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View file

@ -58,13 +58,14 @@ async def async_setup_entry(
class BlinkBinarySensor(BinarySensorEntity):
"""Representation of a Blink binary sensor."""
_attr_has_entity_name = True
def __init__(
self, data, camera, description: BinarySensorEntityDescription
) -> None:
"""Initialize the sensor."""
self.data = data
self.entity_description = description
self._attr_name = f"{DOMAIN} {camera} {description.name}"
self._camera = data.cameras[camera]
self._attr_unique_id = f"{self._camera.serial}-{description.key}"
self._attr_device_info = DeviceInfo(