switches = smartThings
// Initialization
- StringBuilder id = new StringBuilder("switchID0")
- StringBuilder label = new StringBuilder("switch")
- StringBuilder displayName = new StringBuilder("switch0")
- StringBuilder currentSwitch = new StringBuilder()
+ String id = "switchID0"
+ String label = "switch"
+ String displayName = "switch"
+ String currentSwitch
if (init)
- currentSwitch.append("off")
+ currentSwitch = "off"
else
- currentSwitch.append("on")
+ currentSwitch = "on"
switches.add(new Switch(sendEvent, id, label, displayName, currentSwitch))
}
def off(LinkedHashMap metaData) {
off()
}
-
- // Methods to return values
- def getCurrentSwitch() {
- List tmpValues = new ArrayList()
- tmpValues.add(switches[0].getCurrentSwitch())
- return tmpValues
- }
}