Open jghaanstra opened 4 years ago
That can be achieved using something like this:
device.on('change:red', changeHandler)
device.on('change:green', changeHandler)
device.on('change:blue', changeHandler)
let timeout = null
const changeHandler = () => {
if (timeout !== null) {
return
}
timeout = setTimeout(() => {
console.log(device.red, device.green, device.blue)
timeout = null
}, 0)
}
Yeah, I already have something similar in place but just thought it would make more sense to report the RGB color as one entity. Feel free to close it though.
Yeah it might, I'll look in to it.
Nice library. Will probably be using this to integrate Shelly devices with the Homey domotica controller. I have a request though.
Currently the Shelly RGBW2 and Shelly Bulb report color changes with individual reports for each R, G and B values. Is it possible to receive only one status change when the color changes containing all values for red, green and blue channel at once?