1 //Create a class for relay switch device
3 import SmartThing.SmartThings
5 public class RelaySwitches extends SmartThings {
6 List relaySwitches = new ArrayList()
8 RelaySwitches(Closure sendEvent, boolean init) {
9 // Only initialize one time since we only have one device for each capability
10 relaySwitches = smartThings
13 String id = "relaySwitchID0"
14 String label = "switch"
15 String displayName = "relaySwitch"
23 relaySwitches.add(new RelaySwitch(sendEvent, id, label, displayName, currentSwitch))
26 // Methods to set values
31 def on(LinkedHashMap metaData) {
36 relaySwitches[0].off()
39 def off(LinkedHashMap metaData) {