diff --git a/homeassistant/components/nanoleaf/button.py b/homeassistant/components/nanoleaf/button.py index 1c6acc516b8..950dc2a591a 100644 --- a/homeassistant/components/nanoleaf/button.py +++ b/homeassistant/components/nanoleaf/button.py @@ -2,7 +2,7 @@ from aionanoleaf import Nanoleaf -from homeassistant.components.button import ButtonEntity +from homeassistant.components.button import ButtonDeviceClass, ButtonEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant @@ -27,15 +27,15 @@ async def async_setup_entry( class NanoleafIdentifyButton(NanoleafEntity, ButtonEntity): """Representation of a Nanoleaf identify button.""" + _attr_entity_category = EntityCategory.CONFIG + _attr_device_class = ButtonDeviceClass.IDENTIFY + def __init__( self, nanoleaf: Nanoleaf, coordinator: DataUpdateCoordinator[None] ) -> None: """Initialize the Nanoleaf button.""" super().__init__(nanoleaf, coordinator) self._attr_unique_id = f"{nanoleaf.serial_no}_identify" - self._attr_name = f"Identify {nanoleaf.name}" - self._attr_icon = "mdi:magnify" - self._attr_entity_category = EntityCategory.CONFIG async def async_press(self) -> None: """Identify the Nanoleaf.""" diff --git a/homeassistant/components/nanoleaf/entity.py b/homeassistant/components/nanoleaf/entity.py index 0fb043c4cc4..16fb746049d 100644 --- a/homeassistant/components/nanoleaf/entity.py +++ b/homeassistant/components/nanoleaf/entity.py @@ -14,10 +14,12 @@ from .const import DOMAIN class NanoleafEntity(CoordinatorEntity[DataUpdateCoordinator[None]]): """Representation of a Nanoleaf entity.""" + _attr_has_entity_name = True + def __init__( self, nanoleaf: Nanoleaf, coordinator: DataUpdateCoordinator[None] ) -> None: - """Initialize an Nanoleaf entity.""" + """Initialize a Nanoleaf entity.""" super().__init__(coordinator) self._nanoleaf = nanoleaf self._attr_device_info = DeviceInfo( diff --git a/homeassistant/components/nanoleaf/light.py b/homeassistant/components/nanoleaf/light.py index 20992594cb8..f0425594763 100644 --- a/homeassistant/components/nanoleaf/light.py +++ b/homeassistant/components/nanoleaf/light.py @@ -46,6 +46,7 @@ class NanoleafLight(NanoleafEntity, LightEntity): _attr_supported_color_modes = {ColorMode.COLOR_TEMP, ColorMode.HS} _attr_supported_features = LightEntityFeature.EFFECT | LightEntityFeature.TRANSITION + _attr_name = None def __init__( self, nanoleaf: Nanoleaf, coordinator: DataUpdateCoordinator[None] @@ -53,7 +54,6 @@ class NanoleafLight(NanoleafEntity, LightEntity): """Initialize the Nanoleaf light.""" super().__init__(nanoleaf, coordinator) self._attr_unique_id = nanoleaf.serial_no - self._attr_name = nanoleaf.name self._attr_min_mireds = math.ceil(1000000 / nanoleaf.color_temperature_max) self._attr_max_mireds = kelvin_to_mired(nanoleaf.color_temperature_min)