mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Reverse limitlessled color_temp range (#7359)
Reverse limitlessled color_temp range
This commit is contained in:
parent
403a721e91
commit
dbd6f7e4ed
@ -376,12 +376,12 @@ class LimitlessLEDRGBWWGroup(LimitlessLEDGroup):
|
||||
|
||||
def _from_hass_temperature(temperature):
|
||||
"""Convert Home Assistant color temperature units to percentage."""
|
||||
return (temperature - 154) / 346
|
||||
return 1 - (temperature - 154) / 346
|
||||
|
||||
|
||||
def _to_hass_temperature(temperature):
|
||||
"""Convert percentage to Home Assistant color temperature units."""
|
||||
return int(temperature * 346) + 154
|
||||
return 500 - int(temperature * 346)
|
||||
|
||||
|
||||
def _from_hass_brightness(brightness):
|
||||
|
Loading…
x
Reference in New Issue
Block a user