From e4c1824afdbcca05386f512859ffe884e38d8912 Mon Sep 17 00:00:00 2001 From: vlaminck Date: Mon, 26 Sep 2016 14:18:31 -0500 Subject: [PATCH] Fix: reorder events so the feed makes more sense --- .../smartthings/gentle-wake-up.src/gentle-wake-up.groovy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/smartapps/smartthings/gentle-wake-up.src/gentle-wake-up.groovy b/smartapps/smartthings/gentle-wake-up.src/gentle-wake-up.groovy index 9d8b527..3fed2e8 100644 --- a/smartapps/smartthings/gentle-wake-up.src/gentle-wake-up.groovy +++ b/smartapps/smartthings/gentle-wake-up.src/gentle-wake-up.groovy @@ -454,11 +454,14 @@ def sendStopEvent(source) { eventData.value += "cancelled" } - sendControllerEvent(eventData) - // send 100% completion + // send 100% completion event sendTimeRemainingEvent(100) + // send a non-displayed 0% completion to reset tiles sendTimeRemainingEvent(0, false) + + // send sessionStatus event last so the event feed is ordered properly + sendControllerEvent(eventData) } def sendTimeRemainingEvent(percentComplete, displayed = true) {