1 //Create a class for three axis
3 import SmartThing.SmartThings
5 public class ThreeAxises extends SmartThings {
6 List threeAxises = new ArrayList()
8 ThreeAxises(Closure sendEvent, boolean init) {
9 // Only initialize one time since we only have one device for each capability
10 threeAxises = smartThings
13 StringBuilder id = new StringBuilder("threeAxisID0")
14 StringBuilder label = new StringBuilder("threeAxis")
15 StringBuilder displayName = new StringBuilder("threeAxis0")
16 LinkedHashMap threeAxis
19 threeAxis = [x:0, y:0, z:0]
21 threeAxis = [x:1, y:2, z:3]
23 threeAxises.add(new ThreeAxis(sendEvent, id, label, displayName, threeAxis))
26 // Methods to return values
27 def getCurrentThreeAxis() {
28 List tmpValues = new ArrayList()
29 tmpValues.add(threeAxises[0].getCurrentThreeAxis())