1 import groovy.transform.CompileStatic
3 // This function runs when the SmartApp is installed
6 // This is a standard debug statement in Groovy
7 //log.debug "Installed with settings: ${settings}"
11 // This function runs when the SmartApp has been updated
14 //log.debug "Updated with settings: ${settings}"
15 // Notice that all event subscriptions are removed when a SmartApp is updated
20 // This function is where you initialize callbacks for event listeners
23 // The subscribe function takes a input, a state, and a callback method
24 //subscribe(contact, "contact.open", openHandler)
25 //subscribe(contact, "contact.closed", closedHandler)
28 // These are our callback methods
30 def openHandler(evt) {
31 //log.debug "$evt.name: $evt.value"
37 def closedHandler(evt) {
38 //log.debug "$evt.name: $evt.value"
39 // Turn the light off and lock the lock