Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / ColorTemperature / ColorTemperatures.groovy
1 //Create a class for color temperature
2 package ColorTemperature
3 import SmartThing.SmartThings
4
5 public class ColorTemperatures extends SmartThings {
6         List colorTemperatues = new ArrayList()
7
8         ColorTemperatures(Closure sendEvent, boolean init) {
9                 // Only initialize one time since we only have one device for each capability
10                 colorTemperatues = smartThings
11
12                 // Initialization
13                 String id = "colorTemperatureID0"
14                 String label = "colorTemperature"
15                 String displayName = "light"
16                 Integer colorTemperatue
17
18                 if (init)
19                         colorTemperature = 10000
20                 else
21                         colorTemperatues = 15000
22
23                 colorTemperatues.add(new ColorTemperature(sendEvent, id, label, displayName, colorTemperature))
24         }
25         
26         // Methods to set values
27         def setColorTemperature(int newValue) {
28                 colorTemperatues[0].setColorTemperature(newValue)
29         }
30 }