Use shorthand attribute for Coolmaster (#99211)

pull/99154/head
Joost Lekkerkerker 2023-08-28 17:57:51 +02:00 committed by GitHub
parent 377f7cba60
commit 00cc57c4ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 11 deletions

View File

@ -58,12 +58,8 @@ class CoolmasterClimate(CoolmasterEntity, ClimateEntity):
def __init__(self, coordinator, unit_id, info, supported_modes):
"""Initialize the climate device."""
super().__init__(coordinator, unit_id, info)
self._hvac_modes = supported_modes
@property
def unique_id(self):
"""Return unique ID for this device."""
return self._unit_id
self._attr_hvac_modes = supported_modes
self._attr_unique_id = unit_id
@property
def supported_features(self) -> ClimateEntityFeature:
@ -102,11 +98,6 @@ class CoolmasterClimate(CoolmasterEntity, ClimateEntity):
return CM_TO_HA_STATE[mode]
@property
def hvac_modes(self):
"""Return the list of available operation modes."""
return self._hvac_modes
@property
def fan_mode(self):
"""Return the fan setting."""