DVCSMP-1959 fixed issue with logging personal information and unused subscription from SmartApps

This commit is contained in:
David Sainte-Claire
2016-08-16 11:35:04 -07:00
parent 47183ebbff
commit 90384d0852
4 changed files with 8 additions and 12 deletions

View File

@@ -78,7 +78,7 @@ def humidityHandler(evt) {
log.debug "Notification already sent within the last ${deltaMinutes} minutes" log.debug "Notification already sent within the last ${deltaMinutes} minutes"
} else { } else {
log.debug "Humidity Rose Above ${tooHumid}: sending SMS to $phone1 and activating ${mySwitch}" log.debug "Humidity Rose Above ${tooHumid}: sending SMS and activating ${mySwitch}"
send("${humiditySensor1.label} sensed high humidity level of ${evt.value}") send("${humiditySensor1.label} sensed high humidity level of ${evt.value}")
switch1?.on() switch1?.on()
} }
@@ -91,7 +91,7 @@ def humidityHandler(evt) {
log.debug "Notification already sent within the last ${deltaMinutes} minutes" log.debug "Notification already sent within the last ${deltaMinutes} minutes"
} else { } else {
log.debug "Humidity Fell Below ${notHumidEnough}: sending SMS to $phone1 and activating ${mySwitch}" log.debug "Humidity Fell Below ${notHumidEnough}: sending SMS and activating ${mySwitch}"
send("${humiditySensor1.label} sensed high humidity level of ${evt.value}") send("${humiditySensor1.label} sensed high humidity level of ${evt.value}")
switch1?.off() switch1?.off()
} }

View File

@@ -25,14 +25,10 @@ preferences {
def installed() { def installed() {
subscribe(contact1, "contact", contactHandler) subscribe(contact1, "contact", contactHandler)
subscribe(switch1, "switch.on", switchOnHandler)
subscribe(switch1, "switch.off", switchOffHandler)
} }
def updated() { def updated() {
unsubscribe() unsubscribe()
subscribe(contact1, "contact", contactHandler)
subscribe(switch1, "switch.on", switchOnHandler)
subscribe(switch1, "switch.off", switchOffHandler) subscribe(switch1, "switch.off", switchOffHandler)
} }

View File

@@ -77,7 +77,7 @@ def humidityHandler(evt) {
} else { } else {
if (state.lastStatus != "off") { if (state.lastStatus != "off") {
log.debug "Humidity Rose Above $humidityHigh1: sending SMS to $phone1 and deactivating $mySwitch" log.debug "Humidity Rose Above $humidityHigh1: sending SMS and deactivating $mySwitch"
send("${humiditySensor1.label} sensed high humidity level of ${evt.value}, turning off ${switch1.label}") send("${humiditySensor1.label} sensed high humidity level of ${evt.value}, turning off ${switch1.label}")
switch1?.off() switch1?.off()
state.lastStatus = "off" state.lastStatus = "off"
@@ -99,7 +99,7 @@ def humidityHandler(evt) {
} else { } else {
if (state.lastStatus != "on") { if (state.lastStatus != "on") {
log.debug "Humidity Dropped Below $humidityLow1: sending SMS to $phone1 and activating $mySwitch" log.debug "Humidity Dropped Below $humidityLow1: sending SMS and activating $mySwitch"
send("${humiditySensor1.label} sensed low humidity level of ${evt.value}, turning on ${switch1.label}") send("${humiditySensor1.label} sensed low humidity level of ${evt.value}, turning on ${switch1.label}")
switch1?.on() switch1?.on()
state.lastStatus = "on" state.lastStatus = "on"

View File

@@ -69,10 +69,10 @@ def temperatureHandler(evt) {
def alreadySentSms = recentEvents.count { it.doubleValue <= tooCold } > 1 def alreadySentSms = recentEvents.count { it.doubleValue <= tooCold } > 1
if (alreadySentSms) { if (alreadySentSms) {
log.debug "SMS already sent to $phone1 within the last $deltaMinutes minutes" log.debug "SMS already sent within the last $deltaMinutes minutes"
// TODO: Send "Temperature back to normal" SMS, turn switch off // TODO: Send "Temperature back to normal" SMS, turn switch off
} else { } else {
log.debug "Temperature dropped below $tooCold: sending SMS to $phone1 and activating $mySwitch" log.debug "Temperature dropped below $tooCold: sending SMS and activating $mySwitch"
def tempScale = location.temperatureScale ?: "F" def tempScale = location.temperatureScale ?: "F"
send("${temperatureSensor1.displayName} is too cold, reporting a temperature of ${evt.value}${evt.unit?:tempScale}") send("${temperatureSensor1.displayName} is too cold, reporting a temperature of ${evt.value}${evt.unit?:tempScale}")
switch1?.on() switch1?.on()