Fix min and max mireds with HKC (#75744)
This commit is contained in:
parent
0006629ca2
commit
5cb4bbd906
6 changed files with 424 additions and 3 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue