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)
This commit is contained in:
1 parent
1a1571cd52
commit
c67c20f752
1 file changed
+7
-4
@@ -60,10 +60,13 @@ class TwitterNotificationService(BaseNotificationService):
|
||||
def send_message(self, message="", **kwargs):
|
||||
"""Tweet a message, optionally with media."""
|
||||
data = kwargs.get(ATTR_DATA)
|
||||
media = data.get(ATTR_MEDIA)
|
||||
if not self.hass.config.is_allowed_path(media):
|
||||
_LOGGER.warning("'%s' is not in a whitelisted area.", media)
|
||||
return
|
||||
|
||||
media = None
|
||||
if data:
|
||||
media = data.get(ATTR_MEDIA)
|
||||
if not self.hass.config.is_allowed_path(media):
|
||||
_LOGGER.warning("'%s' is not in a whitelisted area.", media)
|
||||
return
|
||||
|
||||
media_id = self.upload_media(media)
|
||||
|
||||
|
||||
Reference in new issue
Block a user