Fix min and max mireds with HKC (#75744)

This commit is contained in:
J. Nick Koston 2022-07-26 04:17:28 -10:00 committed by GitHub
parent 0006629ca2
commit 5cb4bbd906
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 424 additions and 3 deletions

View file

@ -71,6 +71,18 @@ class HomeKitLight(HomeKitEntity, LightEntity):
self.service.value(CharacteristicsTypes.SATURATION),
)
@property
def min_mireds(self) -> int:
"""Return minimum supported color temperature."""
min_value = self.service[CharacteristicsTypes.COLOR_TEMPERATURE].minValue
return int(min_value) if min_value else super().min_mireds
@property
def max_mireds(self) -> int:
"""Return the maximum color temperature."""
max_value = self.service[CharacteristicsTypes.COLOR_TEMPERATURE].maxValue
return int(max_value) if max_value else super().max_mireds
@property
def color_temp(self) -> int:
"""Return the color temperature."""