First-timer needing help with setColor

Hi everyone,
I am still pretty new to all object-oriented programming, but I’ve been tinkering with some basic smartapps so far with success. However, I’m now writing an app that changes my Gen 3 LIFX bulbs, but having some trouble. Below is a simplified excerpt of the code I’m using:

def motionDetectedHandler(evt) {
log.debug “motionDetectedHandler called: $evt”
thelight.setColor(38,100)
// thelight.setHue(38)
// thelight.setSaturation(100)
}

I can’t seem to change the light using the setColor command, but it works with setHue and setSaturation. I’d guess it’s my arguments that aren’t passing correctly, but I’m not sure why.

error groovy.lang.MissingMethodException: No signature of method: script1484550035128543498308.setColor() is applicable for argument types: (java.lang.Integer, java.lang.Integer) values: [38,100]

Again, I’m sure it’s something easy I’m missing with the color map, but I am grateful to anyone taking the time to set me straight. Thanks!

I use this:

def newValue = [hue: hueColor, saturation: saturation, level: lightLevel]  
bulbs.setColor(newValue)
2 Likes

Worked like a charm–thanks for the help!

1 Like