From 18d36e011ac9b2fa23a8cbd8cd7f3234210f2c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A4r=20Svanstr=C3=B6m?= Date: Sun, 30 Dec 2018 18:34:29 +0100 Subject: [PATCH] Added regexp validation allowing Twilio notifications to use Sender ID instead of phone number (#19644) * Added regexp validation allowing Twilio notifications to use Sender ID instead of phone number * Fix line length --- homeassistant/components/notify/twilio_sms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/notify/twilio_sms.py b/homeassistant/components/notify/twilio_sms.py index 52cfe2f436d6..e106c5ae6aa5 100644 --- a/homeassistant/components/notify/twilio_sms.py +++ b/homeassistant/components/notify/twilio_sms.py @@ -21,7 +21,10 @@ CONF_FROM_NUMBER = "from_number" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_FROM_NUMBER): - vol.All(cv.string, vol.Match(r"^\+?[1-9]\d{1,14}$")), + vol.All(cv.string, + vol.Match(r"^\+?[1-9]\d{1,14}$|" + r"^(?=.{1,11}$)[a-zA-Z0-9\s]*" + r"[a-zA-Z][a-zA-Z0-9\s]*$")), })