1 //Create a class for switch device
4 public class switching{
11 switches = [new switches(0, "switch0", "off", "off")]
12 } else if (count == 2) {
13 switches = [new switches(0, "switch0", "off", "off"),new switches(1, "switch1", "off", "off")]
14 } else if (count == 3) {
15 switches = [new switches(0, "switch0", "off", "off"),new switches(1, "switch1", "off", "off"),new switches(2, "switch2", "off", "off")]
27 def on(LinkedHashMap LHM) {
45 def off(LinkedHashMap LHM) {
55 def currentValue(String S) {
57 switches[0].currentValue(S)
59 switches*.currentValue(S)
63 def latestValue(String S) {
65 switches[0].latestValue(S)
67 switches*.latestValue(S)