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

"home/light/main-color/rgb" 1247743 #2

Open
m4dm4rtig4n opened this issue May 3, 2020 · 2 comments
Open

"home/light/main-color/rgb" 1247743 #2

m4dm4rtig4n opened this issue May 3, 2020 · 2 comments

Comments

@m4dm4rtig4n
Copy link

m4dm4rtig4n commented May 3, 2020

Hi, what is this RGB code ? oO
How to convert this to an readable RGB code ?

@monster1025
Copy link
Owner

monster1025 commented May 3, 2020

If I remember right - it is default home assistant rgb value.
It is converted rgb to int:

			# if (key == "rgb" and self._is_int(value)):
			# 	intval = int(value)
			# 	blue =  (intval) & 255
			# 	green = (intval >> 8) & 255
			# 	red =  (intval >> 16) & 255
			# 	value = str(red)+","+str(green)+","+str(blue)

Also, you can send value as "r,g,b" or "255,200,100" - this format is ok too.

@m4dm4rtig4n
Copy link
Author

On Home Assistant i have this error :

May 03 23:17:53 HomeAssistant hass[32734]: 2020-05-03 23:17:53 ERROR (MainThread) [homeassistant.util.logging] Exception in rgb_received when handling msg on 'yeelight/light/salon-lustre/rgb': '16741596'
May 03 23:17:53 HomeAssistant hass[32734]: Traceback (most recent call last):
May 03 23:17:53 HomeAssistant hass[32734]:   File "/usr/local/lib/python3.7/dist-packages/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper
May 03 23:17:53 HomeAssistant hass[32734]:     msg_callback(msg)
May 03 23:17:53 HomeAssistant hass[32734]:   File "/usr/local/lib/python3.7/dist-packages/homeassistant/components/mqtt/light/schema_basic.py", line 361, in rgb_received
May 03 23:17:53 HomeAssistant hass[32734]:     self._hs = color_util.color_RGB_to_hs(*rgb)
May 03 23:17:53 HomeAssistant hass[32734]: TypeError: color_RGB_to_hs() missing 2 required positional arguments: 'iG' and 'iB'

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