"Generic Component RGBW" setColorTemperature oddities

I was just playing around with a "Generic Component RGBW" device (as a child device of a parent device I'm writing) and noticed an oddity:

  • Expected behavior: calling setColorTemperature(temp, level, rate) on child device should call componentSetColorTemperature(childDev. temp. level, rate) on parent (or perhaps some variation thereof, depending on value of optional parameters)
  • Observed behavior: calling setColorTemperature(temp, level, rate) on child device calls componentSetLevel(childDev, level, rate) and componentSetColorTemperature(childDev, temp, null, null) on parent

I can understand the reasoning here, at least historically: the three-parameter setColorTemperature() command was new in 2.2.6, so this risked breaking fewer parent drivers/apps. However, since 2.2.8 began using the "new" command in many built-in apps and (I think?) all built-in drivers caught up and many built-in apps have begun depending on these commands, forcing many community drivers to catch up, this is likely less of a concern.

However, there is no way to force the "new" behavior, so would it be possible to either get an option to prefer this behavior instead--or just make it the normal behavior for this driver now that the "new" command implementation is more widespread? I'm running into a problem with either a device or perhaps just its API that doesn't work as expected if these two commands are sent at nearly the same time, as the current behavior causes (something I may need to look into anyway, but a change like this would help avoid the issue in the first place and should be useful for lots of other devices that also support this action as a single "command").

On a related note, I also still observed the logging issue mentioned here, which as far as I can tell must just be a typo in the log lines since the actual commands receive the values as expected: [BUG] componentSetEffect passes null in Generic Component RGBW Light Effects - #4 by gslender

This sounds like a bug, ill have a look.

Thanks! Also, I noticed a typo in my original post, which I've fixed (setColorTemperature on the child calls setLevel and the classic setColorTemperature on the parent is what I meant). But I'm sure you'll see whatever it is either way. :slight_smile:

Yeah, this driver is a hybrid in that if setColorTemp is called with a level param, then setLevel is called, so in 2.2.9 it will use and call the multi param componentSetColorTemperature method, and the setLevel call dropped

1 Like

Thanks!

EDIT: I should also note that the Generic Component RGBW Effect driver seems to do the same. Didn't test the CT driver but I assume it might too...not sure if you checked them all. :smiley:

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.