diff --git a/homeassistant/components/freedompro/binary_sensor.py b/homeassistant/components/freedompro/binary_sensor.py index c56d3cb2ad8..e648f35d730 100644 --- a/homeassistant/components/freedompro/binary_sensor.py +++ b/homeassistant/components/freedompro/binary_sensor.py @@ -46,12 +46,14 @@ async def async_setup_entry( class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], BinarySensorEntity): """Representation of an Freedompro binary_sensor.""" + _attr_has_entity_name = True + _attr_name = None + def __init__( self, device: dict[str, Any], coordinator: FreedomproDataUpdateCoordinator ) -> None: """Initialize the Freedompro binary_sensor.""" super().__init__(coordinator) - self._attr_name = device["name"] self._attr_unique_id = device["uid"] self._type = device["type"] self._attr_device_info = DeviceInfo( @@ -60,7 +62,7 @@ class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], BinarySensorEnt }, manufacturer="Freedompro", model=device["type"], - name=self.name, + name=device["name"], ) self._attr_device_class = DEVICE_CLASS_MAP[device["type"]] diff --git a/homeassistant/components/freedompro/climate.py b/homeassistant/components/freedompro/climate.py index 0ec08f0fdd0..058b32f932a 100644 --- a/homeassistant/components/freedompro/climate.py +++ b/homeassistant/components/freedompro/climate.py @@ -60,6 +60,7 @@ async def async_setup_entry( class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], ClimateEntity): """Representation of an Freedompro climate.""" + _attr_has_entity_name = True _attr_hvac_modes = SUPPORTED_HVAC_MODES _attr_temperature_unit = UnitOfTemperature.CELSIUS @@ -74,7 +75,7 @@ class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], ClimateEntity): super().__init__(coordinator) self._session = session self._api_key = api_key - self._attr_name = device["name"] + self._attr_name = None self._attr_unique_id = device["uid"] self._characteristics = device["characteristics"] self._attr_device_info = DeviceInfo( @@ -83,7 +84,7 @@ class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], ClimateEntity): }, manufacturer="Freedompro", model=device["type"], - name=self.name, + name=device["name"], ) self._attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE self._attr_current_temperature = 0 diff --git a/homeassistant/components/freedompro/cover.py b/homeassistant/components/freedompro/cover.py index 3839415d31b..03670d06e67 100644 --- a/homeassistant/components/freedompro/cover.py +++ b/homeassistant/components/freedompro/cover.py @@ -48,6 +48,9 @@ async def async_setup_entry( class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], CoverEntity): """Representation of an Freedompro cover.""" + _attr_has_entity_name = True + _attr_name = None + def __init__( self, hass: HomeAssistant, @@ -59,7 +62,6 @@ class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], CoverEntity): super().__init__(coordinator) self._session = aiohttp_client.async_get_clientsession(hass) self._api_key = api_key - self._attr_name = device["name"] self._attr_unique_id = device["uid"] self._attr_device_info = DeviceInfo( identifiers={ @@ -67,7 +69,7 @@ class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], CoverEntity): }, manufacturer="Freedompro", model=device["type"], - name=self.name, + name=device["name"], ) self._attr_current_cover_position = 0 self._attr_is_closed = True diff --git a/homeassistant/components/freedompro/fan.py b/homeassistant/components/freedompro/fan.py index 036c6c91471..0a360f637e2 100644 --- a/homeassistant/components/freedompro/fan.py +++ b/homeassistant/components/freedompro/fan.py @@ -35,6 +35,9 @@ async def async_setup_entry( class FreedomproFan(CoordinatorEntity[FreedomproDataUpdateCoordinator], FanEntity): """Representation of an Freedompro fan.""" + _attr_has_entity_name = True + _attr_name = None + def __init__( self, hass: HomeAssistant, @@ -46,7 +49,6 @@ class FreedomproFan(CoordinatorEntity[FreedomproDataUpdateCoordinator], FanEntit super().__init__(coordinator) self._session = aiohttp_client.async_get_clientsession(hass) self._api_key = api_key - self._attr_name = device["name"] self._attr_unique_id = device["uid"] self._characteristics = device["characteristics"] self._attr_device_info = DeviceInfo( @@ -55,7 +57,7 @@ class FreedomproFan(CoordinatorEntity[FreedomproDataUpdateCoordinator], FanEntit }, manufacturer="Freedompro", model=device["type"], - name=self.name, + name=device["name"], ) self._attr_is_on = False self._attr_percentage = 0 diff --git a/homeassistant/components/freedompro/light.py b/homeassistant/components/freedompro/light.py index 7dc573f9225..4221331adf0 100644 --- a/homeassistant/components/freedompro/light.py +++ b/homeassistant/components/freedompro/light.py @@ -40,6 +40,9 @@ async def async_setup_entry( class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], LightEntity): """Representation of an Freedompro light.""" + _attr_has_entity_name = True + _attr_name = None + def __init__( self, hass: HomeAssistant, @@ -51,13 +54,12 @@ class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], LightEntity): super().__init__(coordinator) self._session = aiohttp_client.async_get_clientsession(hass) self._api_key = api_key - self._attr_name = device["name"] self._attr_unique_id = device["uid"] self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, device["uid"])}, manufacturer="Freedompro", model=device["type"], - name=self.name, + name=device["name"], ) self._attr_is_on = False self._attr_brightness = 0 diff --git a/homeassistant/components/freedompro/lock.py b/homeassistant/components/freedompro/lock.py index d803354c255..099baab7126 100644 --- a/homeassistant/components/freedompro/lock.py +++ b/homeassistant/components/freedompro/lock.py @@ -33,6 +33,9 @@ async def async_setup_entry( class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], LockEntity): """Representation of an Freedompro lock.""" + _attr_has_entity_name = True + _attr_name = None + def __init__( self, hass: HomeAssistant, @@ -45,7 +48,6 @@ class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], LockEntity): self._hass = hass self._session = aiohttp_client.async_get_clientsession(self._hass) self._api_key = api_key - self._attr_name = device["name"] self._attr_unique_id = device["uid"] self._type = device["type"] self._characteristics = device["characteristics"] @@ -55,7 +57,7 @@ class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], LockEntity): }, manufacturer="Freedompro", model=self._type, - name=self.name, + name=device["name"], ) @callback diff --git a/homeassistant/components/freedompro/sensor.py b/homeassistant/components/freedompro/sensor.py index 286a528013a..f95e0436ab4 100644 --- a/homeassistant/components/freedompro/sensor.py +++ b/homeassistant/components/freedompro/sensor.py @@ -54,12 +54,14 @@ async def async_setup_entry( class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], SensorEntity): """Representation of an Freedompro sensor.""" + _attr_has_entity_name = True + _attr_name = None + def __init__( self, device: dict[str, Any], coordinator: FreedomproDataUpdateCoordinator ) -> None: """Initialize the Freedompro sensor.""" super().__init__(coordinator) - self._attr_name = device["name"] self._attr_unique_id = device["uid"] self._type = device["type"] self._attr_device_info = DeviceInfo( @@ -68,7 +70,7 @@ class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], SensorEntity): }, manufacturer="Freedompro", model=device["type"], - name=self.name, + name=device["name"], ) self._attr_device_class = DEVICE_CLASS_MAP[device["type"]] self._attr_state_class = STATE_CLASS_MAP[device["type"]] diff --git a/homeassistant/components/freedompro/switch.py b/homeassistant/components/freedompro/switch.py index 4a7ed80de1e..d1f8e33765a 100644 --- a/homeassistant/components/freedompro/switch.py +++ b/homeassistant/components/freedompro/switch.py @@ -33,6 +33,9 @@ async def async_setup_entry( class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], SwitchEntity): """Representation of an Freedompro switch.""" + _attr_has_entity_name = True + _attr_name = None + def __init__( self, hass: HomeAssistant, @@ -44,7 +47,6 @@ class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], SwitchEntity): super().__init__(coordinator) self._session = aiohttp_client.async_get_clientsession(hass) self._api_key = api_key - self._attr_name = device["name"] self._attr_unique_id = device["uid"] self._attr_device_info = DeviceInfo( identifiers={ @@ -52,7 +54,7 @@ class Device(CoordinatorEntity[FreedomproDataUpdateCoordinator], SwitchEntity): }, manufacturer="Freedompro", model=device["type"], - name=self.name, + name=device["name"], ) self._attr_is_on = False