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

Intensity.math(x).hex does not deliver hex values #879

Closed
Mingarer opened this issue Jan 20, 2018 · 2 comments
Closed

Intensity.math(x).hex does not deliver hex values #879

Mingarer opened this issue Jan 20, 2018 · 2 comments
Milestone

Comments

@Mingarer
Copy link

Mingarer commented Jan 20, 2018

Hi folks,

I need to calculate a string in hex format depending on the brightness.

My url looks like:

http://192.168.178.5/control?cmd=on,typ,tcp,192.168.178.50%3A5577,dta,31${intensity.byte.hex}${intensity.math(X+64).hex}

Brightness of 50% (=128 in abs numbers) delivers these log file entries:

_HueMulator PUT called on api/* with request ... and body <<<{"on":true,"bri":128}>>>

executing HUE api request to Http GET: http://192.168.178.5/control?cmd=on,typ,tcp,192.168.178.50%3A5577,dta,31${intensity.byte.hex}${intensity.math(X+64).hex}

Request <http://192.168.178.5/control?cmd=on,typ,tcp,192.168.178.50%3A5577,dta,3180192>, not done: false_

As you can see the 50% (128) is converted in Hex value 80, i.e. intensity.byte.hex works

intensity.math(x+64).hex is supposed to return hex value C0 but delivers the integer 192. Conversion into hex not done.

Any idea how to fix? I guess the string is correct. I'm on V5.1.0

Thanks in advance!

@bwssytems
Copy link
Owner

Found it. Will be fixed in the next release.

@bwssytems bwssytems added this to the 5.2.0 milestone Jan 26, 2018
@Mingarer
Copy link
Author

You made my day:)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants