Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color State incorrect when fading color (transition is set) #20

Closed
alexschwantes opened this issue Apr 21, 2017 · 1 comment
Closed

Comments

@alexschwantes
Copy link
Contributor

Given the fix for #18 there is now a new bug that is visible where the returned state is incorrect.
When in JSON mode and an MQTT command is sent to change the color the following is observed:

Changing color without transition works fine

SET: { 'color': {'r':0, 'g':255, 'b':0}}
STATE: {"state":"ON","brightness":145,"white_value":0,"color":{"r":0,"g":255,"b":0}}

but when a transition is set, it returns the state of the first step in the fade sequence rather than the actual set color. ie.

SET: { 'color': {'r':255, 'g':0, 'b':0}, 'transition': 4}
STATE: {"state":"ON","brightness":145,"white_value":0,"color":{"r":1,"g":254,"b":0}}

The returned color state is wrong.
This is related a bit to do with the flow of the program and the way the fade changes the m_color variables instead of setting m_color to be the final color and using other variables to handle the fading.

@alexschwantes
Copy link
Contributor Author

Pull request for this issue is #23

smrtnt added a commit that referenced this issue Apr 23, 2017
…t-issue-20

Fix for #20 - color transition now returns correct state
@smrtnt smrtnt closed this as completed Apr 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants