From 44a5a2dc06ba45966a59d5d73636a7e36267bb26 Mon Sep 17 00:00:00 2001 From: iain MacDonnell Date: Tue, 17 Oct 2023 16:59:15 +0100 Subject: [PATCH] Explicitly set entity name for VenstarSensor (#102158) VenstarSensor entity name Set entity name using _attr_name instead of a name property, to avoid warnings about name being implicitly set to None. --- homeassistant/components/venstar/sensor.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/homeassistant/components/venstar/sensor.py b/homeassistant/components/venstar/sensor.py index 2d919bbc1bc1d..7125dfd45400a 100644 --- a/homeassistant/components/venstar/sensor.py +++ b/homeassistant/components/venstar/sensor.py @@ -146,6 +146,7 @@ def __init__( super().__init__(coordinator, config) self.entity_description = entity_description self.sensor_name = sensor_name + self._attr_name = entity_description.name_fn(sensor_name) self._config = config @property @@ -153,11 +154,6 @@ def unique_id(self): """Return the unique id.""" return f"{self._config.entry_id}_{self.sensor_name.replace(' ', '_')}_{self.entity_description.key}" - @property - def name(self): - """Return the name of the device.""" - return self.entity_description.name_fn(self.sensor_name) - @property def native_value(self) -> int: """Return state of the sensor."""