Migrate Melcloud to has entity name (#99025)
This commit is contained in:
parent
e7462e916a
commit
a89a5f486d
5 changed files with 67 additions and 48 deletions
|
@ -99,6 +99,8 @@ class MelCloudClimate(ClimateEntity):
|
|||
"""Base climate device."""
|
||||
|
||||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_has_entity_name = True
|
||||
_attr_name = None
|
||||
|
||||
def __init__(self, device: MelCloudDevice) -> None:
|
||||
"""Initialize the climate."""
|
||||
|
@ -109,11 +111,6 @@ class MelCloudClimate(ClimateEntity):
|
|||
"""Update state from MELCloud."""
|
||||
await self.api.async_update()
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
"""Return a device description for device registry."""
|
||||
return self.api.device_info
|
||||
|
||||
@property
|
||||
def target_temperature_step(self) -> float | None:
|
||||
"""Return the supported step of target temperature."""
|
||||
|
@ -134,8 +131,8 @@ class AtaDeviceClimate(MelCloudClimate):
|
|||
super().__init__(device)
|
||||
self._device = ata_device
|
||||
|
||||
self._attr_name = device.name
|
||||
self._attr_unique_id = f"{self.api.device.serial}-{self.api.device.mac}"
|
||||
self._attr_device_info = self.api.device_info
|
||||
|
||||
@property
|
||||
def extra_state_attributes(self) -> dict[str, Any] | None:
|
||||
|
@ -310,8 +307,8 @@ class AtwDeviceZoneClimate(MelCloudClimate):
|
|||
self._device = atw_device
|
||||
self._zone = atw_zone
|
||||
|
||||
self._attr_name = f"{device.name} {self._zone.name}"
|
||||
self._attr_unique_id = f"{self.api.device.serial}-{atw_zone.zone_index}"
|
||||
self._attr_device_info = self.api.zone_device_info(atw_zone)
|
||||
|
||||
@property
|
||||
def extra_state_attributes(self) -> dict[str, Any]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue