Skip to content

Update common_services.js #444

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

Merged
merged 2 commits into from
Mar 22, 2018
Merged

Update common_services.js #444

merged 2 commits into from
Mar 22, 2018

Conversation

giltesa
Copy link
Contributor

@giltesa giltesa commented Mar 21, 2018

The rgba2hex function was not returning a valid hexadecimal value, the length must always be 8 characters (#RRGGBBWW). There is a condition that allows to send 4 characters instead of 8 but it is better not to shorten the value to facilitate the work in the program of the Arduino sketch.

Incorrect output:
58097 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=8,sg=0:#3d25a209
58531 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=8,sg=0:#3819be0
60297 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=8,sg=0:#3819bec
61145 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=6,sg=0:#fd16c
61790 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=5,sg=0:#334c

Correct output:
589207 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#07112400
589512 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#181e2900
590118 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#182b5200
590553 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#0e3f9e00
591108 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#229e0e00
591978 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#229e0e2b
592775 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#00080900

PS: The RGB picker works fine, only the RGBW picker failed.

giltesa and others added 2 commits March 21, 2018 20:12
The rgba2hex function was not returning a valid hexadecimal value, the length must always be 8 characters (#RRGGBBWW). There is a condition that allows to send 4 characters instead of 8 but it is better not to shorten the value to facilitate the work in the program of the Arduino sketch.

Incorrect output:
58097 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=8,sg=0:#3d25a209
58531 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=8,sg=0:#3819be0
60297 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=8,sg=0:#3819bec
61145 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=6,sg=0:#fd16c
61790 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=5,sg=0:#334c

Correct output:
589207 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#07112400
589512 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#181e2900
590118 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#182b5200
590553 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#0e3f9e00
591108 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#229e0e00
591978 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#229e0e2b
592775 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#00080900

PS: The RGB picker works fine, only the RGBW picker failed.
@jkandasa
Copy link
Member

@giltesa Thank you for the fix and PR!

@jkandasa jkandasa merged commit bfd08e7 into mycontroller-org:development Mar 22, 2018
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

Successfully merging this pull request may close these issues.

2 participants