diff --git a/smartapps/smartthings/notify-me-when.src/notify-me-when.groovy b/smartapps/smartthings/notify-me-when.src/notify-me-when.groovy index f124260..9a55db2 100644 --- a/smartapps/smartthings/notify-me-when.src/notify-me-when.groovy +++ b/smartapps/smartthings/notify-me-when.src/notify-me-when.groovy @@ -48,9 +48,9 @@ preferences { } section("Via a push notification and/or an SMS message"){ input("recipients", "contact", title: "Send notifications to") { - input "phone", "phone", title: "Phone Number (for SMS, optional)", required: false + input "phone", "phone", title: "Enter a phone number to get SMS", required: false paragraph "If outside the US please make sure to enter the proper country code" - input "pushAndPhone", "enum", title: "Both Push and SMS?", required: false, options: ["Yes", "No"] + input "pushAndPhone", "enum", title: "Notify me via Push Notification", required: false, options: ["Yes", "No"] } } section("Minimum time between messages (optional, defaults to every message)") { @@ -111,19 +111,17 @@ private sendMessage(evt) { if (location.contactBookEnabled) { sendNotificationToContacts(msg, recipients, options) } else { - if (!phone || pushAndPhone != 'No') { + if (pushAndPhone != 'No') { log.debug 'sending push' options.method = 'push' - //sendPush(msg) + sendNotification(msg, options) } if (phone) { options.phone = phone log.debug 'sending SMS' - //sendSms(phone, msg) + sendNotification(msg, options) } - sendNotification(msg, options) } - if (frequency) { state[evt.deviceId] = now() }