mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Migrate airtouch 4 to use has entity name (#96356)
This commit is contained in:
parent
fa0d68b1d7
commit
34e30570c1
@ -84,6 +84,9 @@ async def async_setup_entry(
|
|||||||
class AirtouchAC(CoordinatorEntity, ClimateEntity):
|
class AirtouchAC(CoordinatorEntity, ClimateEntity):
|
||||||
"""Representation of an AirTouch 4 ac."""
|
"""Representation of an AirTouch 4 ac."""
|
||||||
|
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
_attr_name = None
|
||||||
|
|
||||||
_attr_supported_features = (
|
_attr_supported_features = (
|
||||||
ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.FAN_MODE
|
ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.FAN_MODE
|
||||||
)
|
)
|
||||||
@ -107,7 +110,7 @@ class AirtouchAC(CoordinatorEntity, ClimateEntity):
|
|||||||
"""Return device info for this device."""
|
"""Return device info for this device."""
|
||||||
return DeviceInfo(
|
return DeviceInfo(
|
||||||
identifiers={(DOMAIN, self.unique_id)},
|
identifiers={(DOMAIN, self.unique_id)},
|
||||||
name=self.name,
|
name=f"AC {self._ac_number}",
|
||||||
manufacturer="Airtouch",
|
manufacturer="Airtouch",
|
||||||
model="Airtouch 4",
|
model="Airtouch 4",
|
||||||
)
|
)
|
||||||
@ -122,11 +125,6 @@ class AirtouchAC(CoordinatorEntity, ClimateEntity):
|
|||||||
"""Return the current temperature."""
|
"""Return the current temperature."""
|
||||||
return self._unit.Temperature
|
return self._unit.Temperature
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""Return the name of the climate device."""
|
|
||||||
return f"AC {self._ac_number}"
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def fan_mode(self):
|
def fan_mode(self):
|
||||||
"""Return fan mode of the AC this group belongs to."""
|
"""Return fan mode of the AC this group belongs to."""
|
||||||
@ -200,6 +198,8 @@ class AirtouchAC(CoordinatorEntity, ClimateEntity):
|
|||||||
class AirtouchGroup(CoordinatorEntity, ClimateEntity):
|
class AirtouchGroup(CoordinatorEntity, ClimateEntity):
|
||||||
"""Representation of an AirTouch 4 group."""
|
"""Representation of an AirTouch 4 group."""
|
||||||
|
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
_attr_name = None
|
||||||
_attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
|
_attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
|
||||||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||||
_attr_hvac_modes = AT_GROUP_MODES
|
_attr_hvac_modes = AT_GROUP_MODES
|
||||||
@ -224,7 +224,7 @@ class AirtouchGroup(CoordinatorEntity, ClimateEntity):
|
|||||||
identifiers={(DOMAIN, self.unique_id)},
|
identifiers={(DOMAIN, self.unique_id)},
|
||||||
manufacturer="Airtouch",
|
manufacturer="Airtouch",
|
||||||
model="Airtouch 4",
|
model="Airtouch 4",
|
||||||
name=self.name,
|
name=self._unit.GroupName,
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -242,11 +242,6 @@ class AirtouchGroup(CoordinatorEntity, ClimateEntity):
|
|||||||
"""Return Max Temperature for AC of this group."""
|
"""Return Max Temperature for AC of this group."""
|
||||||
return self._airtouch.acs[self._unit.BelongsToAc].MaxSetpoint
|
return self._airtouch.acs[self._unit.BelongsToAc].MaxSetpoint
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""Return the name of the climate device."""
|
|
||||||
return self._unit.GroupName
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_temperature(self):
|
def current_temperature(self):
|
||||||
"""Return the current temperature."""
|
"""Return the current temperature."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user