Skip to content

Instantly share code, notes, and snippets.

@rappleg
Created September 5, 2013 14:55
Show Gist options
  • Save rappleg/6451268 to your computer and use it in GitHub Desktop.
Save rappleg/6451268 to your computer and use it in GitHub Desktop.
Doors Child
/**
* Doors Child
*
* Author: ryan
* Date: 2013-08-27
*/
preferences {
page(name: "createDoor", title: "Add a new door", nextPage: "doorDetail") {
section("Add a new door") {
label title:"Give your door a name"
}
}
page(name: "doorDetail", title: "Door Purpose") {
section("What do you want to do with this door?") {
app "doorOpenClose", "Solutions", "Door-Open/Close", title:"Know if it's opened or closed", page: "doorOpenClose", multiple: false, install: true
app "doorKnowControl", "Solutions", "Door-Know/Control", title:"Know and control if the door is locked", page: "doorKnowControl", multiple: false, install: true
app "doorLockUp", "Solutions", "Door-LockUp", title:"Lock up when nobody is at [location]", page: "doorLockUp", multiple: false, install: true
app "doorUnlockWhenHome", "Solutions", "Door-UnlockWhenHome", title:"Unlock When People and Cars Arrive", page: "doorUnlockWhenHome", multiple: false, install: true
}
section(" ") {
href "editDoor", title: "Rename?", description: "Tap to set"
}
}
page(name: "editDoor", title: "Rename?", nextPage: "doorDetail") {
section("Rename your door") {
label title:"Give your door a name"
}
}
}
def installed() {
log.debug "Installed with settings: ${settings}"
subscribeToChildren()
}
def updated() {
log.debug "Updated with settings: ${settings}"
unsubscribe()
subscribeToChildren()
}
def subscribeToChildren() {
childApps.each { app ->
log.debug "Subscribing to child ${app.label}"
subscribe(app)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment