Use device class naming for nobo hub v2 (#96022)

This commit is contained in:
Joost Lekkerkerker 2023-07-08 11:39:53 +02:00 committed by GitHub
parent 6dae3553f2
commit e0274ec854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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":