1 //Create a class for color temperature
2 package ColorTemperature
3 import SmartThing.SmartThings
5 //Importing mutable integer class
6 import MutableInteger.MutableInteger
8 public class ColorTemperatures extends SmartThings {
9 List colorTemperatues = new ArrayList()
11 ColorTemperatures(Closure sendEvent, boolean init) {
12 // Only initialize one time since we only have one device for each capability
13 colorTemperatues = smartThings
16 StringBuilder id = new StringBuilder("colorTemperatureID0")
17 StringBuilder label = new StringBuilder("colorTemperature")
18 StringBuilder displayName = new StringBuilder("colorTemperature0")
19 MutableInteger colorTemperatue = new MutableInteger()
22 colorTemperature = 10000
24 colorTemperatues = 15000
26 colorTemperatues.add(new ColorTemperature(sendEvent, id, label, displayName, colorTemperature))
29 // Methods to set values
30 def setColorTemperature(int newValue) {
31 colorTemperatues[0].setColorTemperature(newValue)
34 // Methods to return values
35 def getCurrentColorTemperature() {
36 List tmpValues = new ArrayList()
37 tmpValues.add(colorTemperatues[0].getCurrentColorTemperature())