Modifying 'Publish a SmartApp for OpenT2T - Fix register all device change handler'

This commit is contained in:
OpenT2T
2017-05-12 18:23:08 -07:00
parent 284828c42f
commit 385463772b

View File

@@ -157,6 +157,17 @@ def registerAllDeviceSubscriptions() {
registerChangeHandler(inputs)
}
//Subscribe to events from a list of devices
def registerChangeHandler(myList) {
myList.each { myDevice ->
def theAtts = myDevice.supportedAttributes
theAtts.each {att ->
subscribe(myDevice, att.name, deviceEventHandler)
log.info "Registering for ${myDevice.displayName}.${att.name}"
}
}
}
//Endpoints function: Subscribe to events from a specific device
def registerDeviceChange() {
def subscriptionEndpt = params.subscriptionURL