Compare commits

...

2 Commits

Author SHA1 Message Date
Kristofer Schaller
1965f10584 Merge pull request #192 from tslagle13/master
Fix requirement for SMS
2015-10-20 13:42:08 -07:00
tslagle13
ecb975540b Fix requirement for SMS
Removed requirement to provide a SMS number is the user does not have contacts. Add logic to verify a number was provided before sending SMS.
2015-10-14 10:05:02 -07:00

View File

@@ -50,7 +50,7 @@ preferences {
} }
section("Send Notifications?") { section("Send Notifications?") {
input("recipients", "contact", title: "Send notifications to") { input("recipients", "contact", title: "Send notifications to") {
input "phone", "phone", title: "Send an SMS to this number?" input "phone", "phone", title: "Send an SMS to this number?", required:false
} }
} }
@@ -266,9 +266,11 @@ def sendAway(msg) {
} }
else { else {
sendPush(msg) sendPush(msg)
if(phone){
sendSms(phone, msg) sendSms(phone, msg)
} }
} }
}
log.debug(msg) log.debug(msg)
} }
@@ -280,9 +282,11 @@ def sendHome(msg) {
} }
else { else {
sendPush(msg) sendPush(msg)
if(phone){
sendSms(phone, msg) sendSms(phone, msg)
} }
} }
}
log.debug(msg) log.debug(msg)
} }