Add image support to hangouts notifications (#16560)

* add image to services.yaml

* add image support

Add image support to hangouts notification.

* fix indents

* fix line length

* Add data schema

forgot schema

* fix linelength

* use is_allowed_path and better file error handling

* elif not else if

* fix logger error

* fixes

* fix travis errors/warnings

* remove trailing whitespace

* fix travis pylint naming

* new async style

* removed unused async_timeout

* change to image_file/url (#3)

* change to image_file/url

* removed whitespace

* forgot to remove unused urlparse import

* image_file/url in service help
This commit is contained in:
Tommy Jonsson 2018-09-25 15:04:43 +02:00 committed by Pascal Vizeli
parent a1c914dfeb
commit bc8d323bdd
3 changed files with 62 additions and 9 deletions

View file

@ -3,7 +3,8 @@ import logging
import voluptuous as vol
from homeassistant.components.notify import ATTR_MESSAGE, ATTR_TARGET
from homeassistant.components.notify \
import ATTR_MESSAGE, ATTR_TARGET, ATTR_DATA
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger('homeassistant.components.hangouts')
@ -56,10 +57,15 @@ MESSAGE_SEGMENT_SCHEMA = vol.Schema({
vol.Optional('parse_str'): cv.boolean,
vol.Optional('link_target'): cv.string
})
MESSAGE_DATA_SCHEMA = vol.Schema({
vol.Optional('image_file'): cv.string,
vol.Optional('image_url'): cv.string
})
MESSAGE_SCHEMA = vol.Schema({
vol.Required(ATTR_TARGET): [TARGETS_SCHEMA],
vol.Required(ATTR_MESSAGE): [MESSAGE_SEGMENT_SCHEMA]
vol.Required(ATTR_MESSAGE): [MESSAGE_SEGMENT_SCHEMA],
vol.Optional(ATTR_DATA): MESSAGE_DATA_SCHEMA
})
INTENT_SCHEMA = vol.All(