Infrastructure compatible with locks, alarms, and thermostats group
[smartthings-infrastructure.git] / ImageCapture / ImageCapture.groovy
1 //Create a class for image capture sensor
2 package ImageCapture
3 import SmartThing.SmartThing
4
5 public class ImageCapture extends SmartThing {
6         // id, label, and display name of the device
7         String id
8         String label
9         String displayName
10         // Maps from features to values
11         HashMap<String, String> deviceValuesMap = new HashMap<String, String>()
12
13         ImageCapture(Closure sendEvent, String id, String label, String displayName, String currentImage) {
14                 deviceValueSmartThing = deviceValuesMap
15                 idSmartThing = id
16                 labelSmartThing = label
17                 displayNameSmartThing = displayName
18                 sendEventSmartThings = sendEvent
19
20                 // Initialization
21                 this.id = id
22                 this.label = label
23                 this.displayName = displayName
24
25                 deviceValuesMap.put("image", currentImage)
26         }
27
28         def take() {
29                 println("The camera with id:$id is taken a picture!")
30         }
31
32         def take(LinkedHashMap metaData) {
33                 take()
34         }
35 }