Hi,
I have 2 types of bulbs in my home, ones that support color change and others that only support temperature change. I want to do a single app that allows me to configure some actions for both cases, but in one case I’ll be changing color and in the other the temperature.
So far, I am stuck at the preferences because I can’ t make preferences to appear conditionally depending on a capability. So far I have the following (that compiles) but that gives me a blank page after selecting the bulb:
preferences { page(name: "examplePage") } def examplePage() { dynamicPage(name: "examplePage", title: "", install: true, uninstall: true) { section { input name: "theBulb", type: "capability.switch", required: true, submitOnChange: true } if(theBulb) { if(theBulb.hasCapability("colorControl")) { input "color", "number", required: true } else { input "temperature", "number", required: true } } } }
Any idea how to proceed? Is there another way to implement this?
Thanks!