Collection of changing entity properties to class attributes - 2 (#51345)

This commit is contained in:
Franck Nijhof 2021-06-01 21:43:55 +02:00 committed by GitHub
parent e5dff49440
commit fcdd8b11a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 70 additions and 215 deletions

View file

@ -35,6 +35,8 @@ HA_MODE_TO_HK = {
class HomeKitHumidifier(HomeKitEntity, HumidifierEntity):
"""Representation of a HomeKit Controller Humidifier."""
_attr_device_class = DEVICE_CLASS_HUMIDIFIER
def get_characteristic_types(self):
"""Define the homekit characteristics the entity cares about."""
return [
@ -45,11 +47,6 @@ class HomeKitHumidifier(HomeKitEntity, HumidifierEntity):
CharacteristicsTypes.RELATIVE_HUMIDITY_HUMIDIFIER_THRESHOLD,
]
@property
def device_class(self) -> str:
"""Return the device class of the device."""
return DEVICE_CLASS_HUMIDIFIER
@property
def supported_features(self):
"""Return the list of supported features."""
@ -140,6 +137,8 @@ class HomeKitHumidifier(HomeKitEntity, HumidifierEntity):
class HomeKitDehumidifier(HomeKitEntity, HumidifierEntity):
"""Representation of a HomeKit Controller Humidifier."""
_attr_device_class = DEVICE_CLASS_DEHUMIDIFIER
def get_characteristic_types(self):
"""Define the homekit characteristics the entity cares about."""
return [
@ -151,11 +150,6 @@ class HomeKitDehumidifier(HomeKitEntity, HumidifierEntity):
CharacteristicsTypes.RELATIVE_HUMIDITY_DEHUMIDIFIER_THRESHOLD,
]
@property
def device_class(self) -> str:
"""Return the device class of the device."""
return DEVICE_CLASS_DEHUMIDIFIER
@property
def supported_features(self):
"""Return the list of supported features."""