Light attributes not being restored correctly


#1

I’m trying to save some attributes of a Hue light to a global variable when a switch comes on, and then restore them when it goes off. I can get the level to work, but the color isn’t being restored.

I tried adding a wait statement, thinking I just needed more time to save the attributes before changing the light, but it didn’t help. Am I just missing something? Seems pretty straightforward, but can’t make it work.


#2

Try restoring color only. If it works, then try capture HSL value and restoring that.

Edit: keep the wait


#3

Looks like it works when I capture and restore HSL… just not color.

Thanks much!


#4

It essentially breaks down as this

color == H/S/L == hex

Problems occur when you start mixing them together