When working with an app I'm trying to write, I stated to focus on the objects vs variables.
It made me consider what the first entry in an input statement was. It appears to have no other function than to identify the device to subscribe to.
I guess in the long run it doesn't really matter but I'm curious to know what it is. Like is it an object? If so what prosperities might it have that could be useful?
The entry I'm referring to; in the below code the entry is "tstatSet"
Thanks
John
def mainPage() {
dynamicPage(name: "mainPage", title: " ", install: true, uninstall: true) {
section {
input "tstatSet", "capability.thermostat", title: "Select Thermostat to Ctrl", submitOnChange: true, required: true, multiple: false
}}}
def installed() {
initialize()
}
def updated() {
unsubscribe()
initialize()
}
def initialize() {
subscribe(tstatSet, "thermostatSetpoint", currentSetPtHandler)