mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-25 05:04:09 +00:00
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.
This commit is contained in:
@@ -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,7 +266,9 @@ def sendAway(msg) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sendPush(msg)
|
sendPush(msg)
|
||||||
sendSms(phone, msg)
|
if(phone){
|
||||||
|
sendSms(phone, msg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,7 +282,9 @@ def sendHome(msg) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sendPush(msg)
|
sendPush(msg)
|
||||||
sendSms(phone, msg)
|
if(phone){
|
||||||
|
sendSms(phone, msg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,4 +343,4 @@ private getTimeIntervalLabel() {
|
|||||||
|
|
||||||
private hideOptionsSection() {
|
private hideOptionsSection() {
|
||||||
(starting || ending || days || modes) ? false: true
|
(starting || ending || days || modes) ? false: true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user