1 //Create a class for smoke detector
3 import SmartThing.SmartThing
5 public class SmokeDetector extends SmartThing {
6 // id, label, and display name of the device
10 // Maps from features to values
11 HashMap<String, String> deviceValuesMap = new HashMap<String, String>()
13 SmokeDetector(Closure sendEvent, String id, String label, String displayName, String currentSmoke) {
14 deviceValueSmartThing = deviceValuesMap
16 labelSmartThing = label
17 displayNameSmartThing = displayName
18 sendEventSmartThings = sendEvent
23 this.displayName = displayName
25 deviceValuesMap.put("smoke", currentSmoke)