I finally had enough and decided to modify the code when I got woken up by my sunrise color temperature change rule on New Years day, with a raging hangover...
It is Hubitat convention that a setLevel, setColor, or setColorTemperature will turn a bulb (or dimmer) on if off. Recently-ish, Hubitat added "Enable color prestaging" and "Enable level prestaging" options to some drivers to modify the behavior in the ways you describe. You can see an example of this in their generic Zigbee RGBW bulb driver, published here:
So, if you're wondering why they did it that way, that is probably why. Hubitat will certainly implement their driver in the same way (assuming they have plans to do this). If you want to modify it in a Hubitat-like way, I'd suggest adding one of the options above like they did in the RGBW Zigbee bulb driver, then turning that feature on--something Hubitat will probably do if/when they add support for these natively. Then your driver would be consistent with others. Obviously, if you're only using this for yourself and know how it works, it won't matter--just a short history lesson.
Is this the multi-color bulb? I donβt actually have one of those yet... I just have the multi-white.. I will be ordering one probably tomorrow and see what I can do for that driver...
Ok... While this code change does fix the issue of being able to do color pre-staging β¦ I am now realizing what a hot mess the original code was.. Lots of stuff broken... I have already fixed the ability to do fine grain tuning of color temperature.. I am working on fixing the reporting of color temperature..
I have updated the code for the multi-white .. fixes setting any color temperature in the range the bulb supports 2700-6500k and now reports back the color temperature...
There was a lot of changes to make this work.. I will need to wait until I have the multi-color bulb to fix that one..
Took a first attempt to merge the color temp fixes from the multi-white to the multi-color code.. (I still don't have this to test) .. I also added importurl to both devices ..