/** */ definition( name: "Whats On Parent", namespace: "Mark-C-UK", author: "Mark C", description: "Whats ON - parent app", category: "Convenience", iconUrl: "", iconX2Url: "", iconX3Url: "") preferences { page name: "mainPage", title: "", install: true, uninstall: true } def installed() { log.info "Installed with settings: ${settings}" initialize() } def updated() { log.info "Updated with settings: ${settings}" unsubscribe() initialize() } def initialize() { log.info "There are ${childApps.size()} child apps" childApps.each { child -> log.info "Child app: ${child.label}" } } def installCheck() { state.appInstalled = app.getInstallationState() if (state.appInstalled != 'COMPLETE') { section{paragraph "Please hit 'Done' to install '${app.label}' parent app "} } else { log.info "Parent Installed OK" } } def mainPage() { dynamicPage(name: "mainPage") { installCheck() if (state.appInstalled == 'COMPLETE') { section("Whats on Parent") { paragraph "These apps will allow you to check what is on on the update of a switch" } section("Manage Children") { app(name: "Whats On Child", appName: "Whats On Child", namespace: "Mark-C-UK", title: "Add child", multiple: true) } } } }