Created
July 7, 2015 19:04
-
-
Save jimmyjames/532f1832e46af3ea2c7d to your computer and use it in GitHub Desktop.
subscribe to events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def installed() { | |
subscribe(theDoor, "contact.open", doorOpenHandler) | |
} | |
def doorOpenHandler(evt) { | |
// ... | |
// send a notification that the door openend, maybe only when everyone is away | |
sendSms(phoneNumber, "The door is open!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment