Follow [Twitter's guidance](https://dev.twitter.com/rest/reference/post/media/upload-finalize) for media uploads: "If and (only if) the response of the FINALIZE command contains a processing_info field, it may also be necessary to use a STATUS command and wait for it to return success before proceeding to Tweet creation."
data may be None if twitter data property unconfigured:
File "/opt/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/notify/twitter.py", line 63, in send_message
media = data.get(ATTR_MEDIA)
* Allow notifications to include media, with Twitter as the first implementation. The Twitter notifier uses the Twitter-recommended async chunked media/upload approach and tries to convey the correct mime type of the media. Twitter implementation based on https://github.com/geduldig/TwitterAPI/blob/master/examples/upload_video.py.
* Changes based on balloob's review:
balloob: "Please remove this file. We fixed the issue in our tests that left this artifact."
balloob: "…prefer a guard clause"
balloob: "This is very inefficient. You are now generating up to 99 values."
balloob: "Since media_id is going to be None, why not just return None and you can remove the else."
* balloob: "Other notify platforms are using ATTR_DATA for it. That way if a platform requires extra metadata, we don't need to add extra fields. So please add it to Twitter via ATTR_DATA."
* Add mysensors notify platform
* Make add_devices optional in platform callback function.
* Use new argument structure for all existing mysensors platforms.
* Add notify platform.
* Update mysensors gateway.
* Refactor notify setup
* Enable discovery of notify platforms.
* Update and add tests for notify component and some platforms.
* Continue setup of notify platforms if a platform fails setup.
* Remove notify tests that check platform config. These tests are not
needed when config validation is used.
* Add config validation to APNS notify platform.
* Use discovery to set up mysensors notify platform.
* Add discovery_info to get_service and update tests
* Add discovery_info as keyword argument to the get_service function
signature and update all notify platforms.
* Update existing notify tests to check config validation using test
helper.
* Add removed tests back in that checked config in apns, command_line
and file platforms, but use config validation test helper to verify
config.
* Add a test for notify file to increase coverage.
* Fix some PEP issues.
* Fix comments and use more constants
* Move apns notify service under notify domain