1
mirror of https://github.com/home-assistant/core synced 2024-08-31 05:57:13 +02:00

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
This commit is contained in:
Pär Svanström 2018-12-30 18:34:29 +01:00 committed by Fabian Affolter
parent 6d44245456
commit 18d36e011a

View File

@ -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]*$")),
})