hueLamps.setColor(level: 100, hue: 20, saturation: 80)
// notice the "?." operator - tvLights may not be set (required: false).
- tvLights?.setColor(level: 100, hue: 100, saturation: 100)
- otherLights?.on()
+ tvLights.setColor(level: 100, hue: 100, saturation: 100)
+ otherLights.on()
}
// turn everything off
log.debug "handleButton1Held"
hueLamps.off()
- tvLights?.off()
- otherLights?.off()
+ tvLights.off()
+ otherLights.off()
}
// soft, dim white light
hueLamps.setColor(level: 50, hue: 20, saturation: 80)
tvLights.setColor(level: 30, hue: 70, saturation: 70)
- otherLights?.on()
+ otherLights.on()
}
// set to what you want!
// dim red light
def handleButton3Pushed() {
hueLamps.setColor(level: 40, hue: 100, saturation: 100)
- tvLights?.setColor(level: 30, hue: 100, saturation: 100)
- otherLights?.off()
+ tvLights.setColor(level: 30, hue: 100, saturation: 100)
+ otherLights.off()
}
// set to what you want!
log.debug "handleButton4Pushed"
hueLamps.setColor(level: 10, hue: 70, saturation: 100)
- tvLights?.setColor(level: 10, hue: 70, saturation: 100)
- otherLights?.off()
+ tvLights.setColor(level: 10, hue: 70, saturation: 100)
+ otherLights.off()
}
// debug information