mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Fix Min/Max Kelvin color temp attribute for Google (#15697)
* Fix Min/Max Kelvin color temp attribute for Google Max Kelvin is actually Min Mireds and vice-versa. K = 1000000 / mireds * Update test_smart_home.py * Update test_trait.py
This commit is contained in:
committed by
Paulus Schoutsen
parent
48af5116b3
commit
38928c4c0e
@@ -304,10 +304,12 @@ class ColorTemperatureTrait(_Trait):
|
||||
def sync_attributes(self):
|
||||
"""Return color temperature attributes for a sync request."""
|
||||
attrs = self.state.attributes
|
||||
# Max Kelvin is Min Mireds K = 1000000 / mireds
|
||||
# Min Kevin is Max Mireds K = 1000000 / mireds
|
||||
return {
|
||||
'temperatureMinK': color_util.color_temperature_mired_to_kelvin(
|
||||
attrs.get(light.ATTR_MIN_MIREDS)),
|
||||
'temperatureMaxK': color_util.color_temperature_mired_to_kelvin(
|
||||
attrs.get(light.ATTR_MIN_MIREDS)),
|
||||
'temperatureMinK': color_util.color_temperature_mired_to_kelvin(
|
||||
attrs.get(light.ATTR_MAX_MIREDS)),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user