Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added regexp validation allowing Twilio notifications to use Sender ID instead of phone number #19644

Merged
merged 2 commits into from
Dec 30, 2018

Conversation

psvanstrom
Copy link

@psvanstrom psvanstrom commented Dec 29, 2018

Description:

Twilio now supports alphanumerical sender IDs to be used when sending SMS, see https://support.twilio.com/hc/en-us/articles/223181348-Getting-started-with-Alphanumeric-Sender-ID for more information. Sender IDs are available for all paid Twilio accounts and are supported in most countries.

The upside of using sender IDs instead of phone numbers is that you don't have to subscribe to a phone number, the only cost when sending SMS messages will be the actual fee for the message.

This PR updates the regular expression validating the from_number configuration parameter so that it allows both phone numbers as well as sender IDs, by applying the rules enforced by Twilio:

Alphanumeric Sender ID supports up to 11 characters from the following categories:
Upper-case letters A-Z
Lower-case letters a-z
Numbers 0-9
Spaces
Your ID must include at least one letter; It cannot be comprised of only numbers. Non-ASCII special characters and punctuation are not allowed.

Example entry for configuration.yaml:

notify:
  - name: NOTIFIER_NAME
    platform: twilio_sms
    from_number: MyHouse

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#7980

psvanstrom pushed a commit to psvanstrom/home-assistant.io that referenced this pull request Dec 29, 2018
Update the SMS configuration documentation with Sender ID as proposed in this PR: home-assistant/core#19644
@fabaff
Copy link
Member

fabaff commented Dec 29, 2018

@psvanstrom, could you please update the requirement in a different PR as you have a working Twilio setup to test it?

Thanks

@psvanstrom
Copy link
Author

@fabaff I'd love to, but I don't really understand what you mean with "update the requirement"? 😄 This is my first PR in home-assistant so I might have missed something obvious?

@fabaff
Copy link
Member

fabaff commented Dec 29, 2018

The Twilio component (twilio/__init__.py) has REQUIREMENTS = ['twilio==6.19.1']. This defines the release of the module we are using. The latest release of twilio is 6.22.0. It's always good to test the upgrades of the Python modules and a real test requires that a person has a working setup and is using the integration.

Change the requirement (REQUIREMENTS = ['twilio==6.22.0']) and run script/gen_requirements_all.py.

@psvanstrom
Copy link
Author

Ah ok, will do that! Is it ok if I do that in this PR or should it be in a separate one?

@fabaff
Copy link
Member

fabaff commented Dec 30, 2018

Please create a new PR. Easier to keep track of changes if there is one per PR and the IPv6 support seems to be independent from an upgrade to the Twilio Python module.

@fabaff fabaff merged commit 18d36e0 into home-assistant:dev Dec 30, 2018
@ghost ghost removed the in progress label Dec 30, 2018
@psvanstrom psvanstrom deleted the allow-sender-id-for-twilio-sms branch December 30, 2018 19:52
fabaff pushed a commit to home-assistant/home-assistant.io that referenced this pull request Dec 31, 2018
Update the SMS configuration documentation with Sender ID as proposed in this PR: home-assistant/core#19644
@balloob balloob mentioned this pull request Jan 10, 2019
alandtse pushed a commit to alandtse/home-assistant that referenced this pull request Feb 12, 2019
…D instead of phone number (home-assistant#19644)

* Added regexp validation allowing Twilio notifications to use Sender ID instead of phone number

* Fix line length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants