core: Lifx no longer changing color when color changes are called in an automation
The problem
Automations and scrips that call for lifx to call a color change like a flashing alert are no longer changing the colors. I have tested with color_name and rgb_color values.
What is version of Home Assistant Core has the issue?
core-2021.4.2
What was the last working version of Home Assistant Core?
core-2021.3.x
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Lifx
Link to integration documentation on our website
https://www.home-assistant.io/integrations/lifx/
Example YAML snippet
alias: Flash GREEN
sequence:
- service: lifx.effect_pulse
data:
color_name: lime
mode: blink
cycles: '4'
entity_id:
- light.office_1
- light.office_2
period: '1'
mode: single
icon: 'mdi:lightbulb-on-outline'
Anything in the logs that might be useful for us?
no error messages found, the lights flash like they did before only now they all flash white. in the stack trace the automations trigger and complete with no errors. Additionally when i bring up the color wheel on any light, all colors are fully available and and functioning correctly. the issue is only when I try to call colors in automations.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 22 (10 by maintainers)
I’ve located the exact issue.
lifx.set_state and lifx.effect_pulse both call find_hsbk, which relies on preprocess_turn_on_alternatives. In #47720, the function, preprocess_turn_on_alternatives that converts the color_name to rgb continues to work, however, the rgb_color is no longer converted to hs_color. You can fix this by reverting this change:
https://github.com/home-assistant/core/pull/47720/files#diff-aa89c7931fb094148a40a16da40321322ea975cda7f8acbc0492460989a359afL169-L175
I do see that there was a related architecture discussion https://github.com/home-assistant/architecture/discussions/519, and I haven’t read enough into it yet, otherwise I would make a PR to revert these lines.
The @emontnemery fix works, I reworked it a bit in #49822. We missed the first beta but should make it in well before the final.
I just noticed this issue. I can fix it soon, starting with the @emontnemery patch above.
It’s fixed in Home Assistant 2021.5.0 (released yesterday).