1 //Create a class for color temperature
2 package ColorTemperature
3 import SmartThing.SmartThings
5 public class ColorTemperatures extends SmartThings {
6 List colorTemperatues = new ArrayList()
8 ColorTemperatures(Closure sendEvent, boolean init) {
9 // Only initialize one time since we only have one device for each capability
10 colorTemperatues = smartThings
13 StringBuilder id = new StringBuilder("colorTemperatureID0")
14 StringBuilder label = new StringBuilder("colorTemperature")
15 StringBuilder displayName = new StringBuilder("colorTemperature0")
16 MutableInteger colorTemperatue = new MutableInteger()
19 colorTemperature = 10000
21 colorTemperatues = 15000
23 colorTemperatues.add(new ColorTemperature(sendEvent, id, label, displayName, colorTemperature))
26 // Methods to set values
27 def setColorTemperature(int newValue) {
28 colorTemperatues[0].setColorTemperature(newValue)
31 // Methods to return values
32 def getCurrentColorTemperature() {
33 List tmpValues = new ArrayList()
34 tmpValues.add(colorTemperatues[0].getCurrentColorTemperature())