1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-02 00:20:30 +01:00

Migrate touchline to has_entity_name = true (#166403)

This commit is contained in:
Joost Lekkerkerker
2026-03-25 10:15:16 +01:00
committed by GitHub
parent d5ff890a18
commit 31b12701dc
2 changed files with 6 additions and 5 deletions

View File

@@ -136,6 +136,8 @@ async def async_setup_platform(
class Touchline(ClimateEntity):
"""Representation of a Touchline device."""
_attr_has_entity_name = True
_attr_name = None
_attr_hvac_mode = HVACMode.HEAT
_attr_hvac_modes = [HVACMode.HEAT]
_attr_preset_modes = list(PRESET_MODES)
@@ -148,13 +150,12 @@ class Touchline(ClimateEntity):
def __init__(self, touchline_thermostat):
"""Initialize the Touchline device."""
self.unit = touchline_thermostat
self._attr_name = self.unit.get_name()
self._device_id = self.unit.get_device_id()
self._controller_id = self.unit.get_controller_id()
self._attr_unique_id = f"{self._controller_id}_{self._device_id}"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, self._attr_unique_id)},
name=self._attr_name,
name=touchline_thermostat.get_name(),
manufacturer="Roth",
)
self._attr_current_temperature = self.unit.get_current_temperature()

View File

@@ -28,19 +28,19 @@
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.zone_1',
'has_entity_name': False,
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Zone 1',
'object_id_base': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Zone 1',
'original_name': None,
'platform': 'touchline',
'previous_unique_id': None,
'suggested_object_id': None,