Infrastructure that works for all the locks' group!
[smartthings-infrastructure.git] / SleepSensor / SleepSensor.groovy
1 //Create a class for sleep sensor
2 package SleepSensor
3 import Timer.SimulatedTimer
4
5 public class SleepSensor {
6         private String id
7         private String label
8         private String displayName
9         private String sleeping
10
11         SleepSensor(String id, String label, String displayName, String sleeping) {
12                 this.id = id
13                 this.label = label
14                 this.displayName = displayName
15                 this.sleeping = sleeping
16         }
17
18         //By Model Checker
19         def setValue(String value) {
20                 println("the sleeping state is changed to $value!")
21                 this.sleeping = value
22         }
23 }