From d4fd778a644c4247745b5910b292cfbf84818116 Mon Sep 17 00:00:00 2001 From: Lars Finander Date: Mon, 15 May 2017 13:25:44 -0600 Subject: [PATCH] DVCSMP-2656 OpenT2T: Update to 5/15 submission --- .../opent2t-smartapp-test.groovy | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/smartapps/opent2t/opent2t-smartapp-test.src/opent2t-smartapp-test.groovy b/smartapps/opent2t/opent2t-smartapp-test.src/opent2t-smartapp-test.groovy index 24d829c..c1e6bff 100644 --- a/smartapps/opent2t/opent2t-smartapp-test.src/opent2t-smartapp-test.groovy +++ b/smartapps/opent2t/opent2t-smartapp-test.src/opent2t-smartapp-test.groovy @@ -162,6 +162,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