From e0274ec854ceeed7d5c1158f889436dac8f1e656 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sat, 8 Jul 2023 11:39:53 +0200 Subject: [PATCH] Use device class naming for nobo hub v2 (#96022) --- homeassistant/components/nobo_hub/climate.py | 4 ++-- homeassistant/components/nobo_hub/sensor.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/nobo_hub/climate.py b/homeassistant/components/nobo_hub/climate.py index f55dc9344ab..00667c43fdb 100644 --- a/homeassistant/components/nobo_hub/climate.py +++ b/homeassistant/components/nobo_hub/climate.py @@ -73,6 +73,8 @@ class NoboZone(ClimateEntity): controlled as a unity. """ + _attr_name = None + _attr_has_entity_name = True _attr_max_temp = MAX_TEMPERATURE _attr_min_temp = MIN_TEMPERATURE _attr_precision = PRECISION_TENTHS @@ -87,8 +89,6 @@ class NoboZone(ClimateEntity): self._id = zone_id self._nobo = hub self._attr_unique_id = f"{hub.hub_serial}:{zone_id}" - self._attr_name = None - self._attr_has_entity_name = True self._attr_hvac_mode = HVACMode.AUTO self._attr_hvac_modes = [HVACMode.HEAT, HVACMode.AUTO] self._override_type = override_type diff --git a/homeassistant/components/nobo_hub/sensor.py b/homeassistant/components/nobo_hub/sensor.py index c5536bad6ea..9cc957ec1df 100644 --- a/homeassistant/components/nobo_hub/sensor.py +++ b/homeassistant/components/nobo_hub/sensor.py @@ -46,6 +46,7 @@ class NoboTemperatureSensor(SensorEntity): _attr_native_unit_of_measurement = UnitOfTemperature.CELSIUS _attr_state_class = SensorStateClass.MEASUREMENT _attr_should_poll = False + _attr_has_entity_name = True def __init__(self, serial: str, hub: nobo) -> None: """Initialize the temperature sensor.""" @@ -54,8 +55,6 @@ class NoboTemperatureSensor(SensorEntity): self._nobo = hub component = hub.components[self._id] self._attr_unique_id = component[ATTR_SERIAL] - self._attr_name = "Temperature" - self._attr_has_entity_name = True zone_id = component[ATTR_ZONE_ID] suggested_area = None if zone_id != "-1":