ammdc7
(ammdc7)
September 2, 2016, 4:01pm
21
Honestly I was hoping someone more knowledgeable would stop by to answer… but yes I would expect that you could edit the file and then restart HA and you would be golden.
I have never done that, so don’t know if it would be permanent through an update or not.
aymercury
(Aymercury)
September 6, 2016, 4:39pm
22
Finally had time to look at this…
I edited lifx.py in two places, replaced the current color temperature calculation with the following:
place 1
def color_temp(self):
"""Return the color temperature."""
#temperature = int(TEMP_MIN_HASS + (TEMP_MAX_HASS - TEMP_MIN_HASS) *
# (self._kel - TEMP_MIN) / (TEMP_MAX - TEMP_MIN))
temperature = int(1000000 / self._kel)
place 2
if ATTR_COLOR_TEMP in kwargs:
# pylint: disable=fixme
# TODO: Use color_temperature_mired_to_kelvin from util.color
#kelvin = int(((TEMP_MAX - TEMP_MIN) *
# (kwargs[ATTR_COLOR_TEMP] - TEMP_MIN_HASS) /
# (TEMP_MAX_HASS - TEMP_MIN_HASS)) + TEMP_MIN)
kelvin = int(1000000/kwargs[ATTR_COLOR_TEMP])
After that (and hass restart) I see the expected colors from the bulbs, and they match what flux tells them to be.
2 Likes
dicko72
(Mark Dixon)
September 21, 2016, 9:22am
23
Thanks @aymercury , this did the trick!
maud
January 22, 2017, 8:52am
24
@aymercury can you tell me where to find the lifx.py file?
Also, do either of you know how to tell flux not to adjust brightness? I tried setting it to brightness: -1
but got this error
Invalid config for [switch.flux]: value must be at least 0 for dictionary value @ data[‘brightness’]. Got -1.
aymercury
(Aymercury)
February 27, 2017, 6:20pm
25
I replied in some other thread with the file location.
For brightness I used 0-255 values, 100 for dim movie mode, for example.
I’m sure you already found the answer to your question, but just in case anyone else is looking, you can disable brightness adjustment with the following:
> disable_brightness_adjust: True