Adjusting setLocationMode for global-variable conflict detection.
[smartthings-infrastructure.git] / ImageCapture / ImageCapture.groovy
index 5e8748b2c861cd0b4593da9a2705530ad54eb5ad..0672e60cf63d1d732fe87108c05a3b8bacc6c9d8 100644 (file)
@@ -8,6 +8,7 @@ public class ImageCapture {
        private String displayName
        private String image
        private String alarmState
+       def timers
 
        ImageCapture(String id, String label, String displayName, String image, String alarmState) {
                this.id = id
@@ -15,6 +16,7 @@ public class ImageCapture {
                this.displayName = displayName
                this.image = image
                this.alarmState = alarmState
+               this.timers = new SimulatedTimer()
        }
        
        def alarmOn() {
@@ -34,4 +36,10 @@ public class ImageCapture {
        def take() {
                println("The camera with id:$id is taken a picture!")
        }
+
+       def take(LinkedHashMap metaData) {
+               def task = timers.runAfter(metaData["delay"]) {
+                       println("The camera with id:$id is taken a picture!")
+               }
+       }
 }