From 383f72580a500df4e636f48efad1e3c1529b7089 Mon Sep 17 00:00:00 2001 From: Juan Pablo Risso Date: Tue, 6 Sep 2016 11:39:18 -0400 Subject: [PATCH] SSVD-2738 - SSVD-2734 - SSVD-2733 (#1187) * SSVD-2738 - Count Down Bug * SSVD-2734 - Copy text * SSVD-2733 - Add Unit --- .../resteele/monitor-on-sense.src/monitor-on-sense.groovy | 8 +++----- .../smartthings/energy-alerts.src/energy-alerts.groovy | 6 ++++-- .../smartthings/gentle-wake-up.src/gentle-wake-up.groovy | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/smartapps/resteele/monitor-on-sense.src/monitor-on-sense.groovy b/smartapps/resteele/monitor-on-sense.src/monitor-on-sense.groovy index d1f3c1f..b547214 100644 --- a/smartapps/resteele/monitor-on-sense.src/monitor-on-sense.groovy +++ b/smartapps/resteele/monitor-on-sense.src/monitor-on-sense.groovy @@ -17,7 +17,7 @@ definition( name: "Monitor on Sense", namespace: "resteele", author: "Rachel Steele", - description: "Turn on Monitor when vibration is sensed", + description: "Turn on switch when vibration is sensed", category: "My Apps", iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png", iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png", @@ -25,10 +25,10 @@ definition( preferences { - section("When the keyboard is used...") { + section("When vibration is sensed...") { input "accelerationSensor", "capability.accelerationSensor", title: "Which Sensor?" } -section("Turn on/off a light...") { +section("Turn on switch...") { input "switch1", "capability.switch" } } @@ -47,5 +47,3 @@ def updated() { def accelerationActiveHandler(evt) { switch1.on() } - - diff --git a/smartapps/smartthings/energy-alerts.src/energy-alerts.groovy b/smartapps/smartthings/energy-alerts.src/energy-alerts.groovy index 2aad9bb..4a4c9ff 100644 --- a/smartapps/smartthings/energy-alerts.src/energy-alerts.groovy +++ b/smartapps/smartthings/energy-alerts.src/energy-alerts.groovy @@ -64,10 +64,12 @@ def meterHandler(evt) { def lastValue = atomicState.lastValue as double atomicState.lastValue = meterValue + def dUnit ? evt.unit : "Watts" + def aboveThresholdValue = aboveThreshold as int if (meterValue > aboveThresholdValue) { if (lastValue < aboveThresholdValue) { // only send notifications when crossing the threshold - def msg = "${meter} reported ${evt.value} ${evt.unit} which is above your threshold of ${aboveThreshold}." + def msg = "${meter} reported ${evt.value} ${dUnit} which is above your threshold of ${aboveThreshold}." sendMessage(msg) } else { // log.debug "not sending notification for ${evt.description} because the threshold (${aboveThreshold}) has already been crossed" @@ -78,7 +80,7 @@ def meterHandler(evt) { def belowThresholdValue = belowThreshold as int if (meterValue < belowThresholdValue) { if (lastValue > belowThresholdValue) { // only send notifications when crossing the threshold - def msg = "${meter} reported ${evt.value} ${evt.unit} which is below your threshold of ${belowThreshold}." + def msg = "${meter} reported ${evt.value} ${dUnit} which is below your threshold of ${belowThreshold}." sendMessage(msg) } else { // log.debug "not sending notification for ${evt.description} because the threshold (${belowThreshold}) has already been crossed" 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 e5b34ae..e5f60b7 100644 --- a/smartapps/smartthings/gentle-wake-up.src/gentle-wake-up.groovy +++ b/smartapps/smartthings/gentle-wake-up.src/gentle-wake-up.groovy @@ -761,7 +761,7 @@ String displayableTime(timeRemaining) { return "${minutes}:00" } def fraction = "0.${parts[1]}" as double - def seconds = "${60 * fraction as int}".padRight(2, "0") + def seconds = "${60 * fraction as int}".padLeft(2, "0") return "${minutes}:${seconds}" } @@ -1101,4 +1101,4 @@ def hasStartLevel() { def hasEndLevel() { return (endLevel != null && endLevel != "") -} \ No newline at end of file +}