diff --git a/homeassistant/components/notify/hangouts.py b/homeassistant/components/notify/hangouts.py index 01f98146f4c6..7261663b99fc 100644 --- a/homeassistant/components/notify/hangouts.py +++ b/homeassistant/components/notify/hangouts.py @@ -9,13 +9,12 @@ import logging import voluptuous as vol from homeassistant.components.notify import (ATTR_TARGET, PLATFORM_SCHEMA, - NOTIFY_SERVICE_SCHEMA, BaseNotificationService, ATTR_MESSAGE, ATTR_DATA) from homeassistant.components.hangouts.const \ - import (DOMAIN, SERVICE_SEND_MESSAGE, MESSAGE_DATA_SCHEMA, - TARGETS_SCHEMA, CONF_DEFAULT_CONVERSATIONS) + import (DOMAIN, SERVICE_SEND_MESSAGE, TARGETS_SCHEMA, + CONF_DEFAULT_CONVERSATIONS) _LOGGER = logging.getLogger(__name__) @@ -25,11 +24,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_DEFAULT_CONVERSATIONS): [TARGETS_SCHEMA] }) -NOTIFY_SERVICE_SCHEMA = NOTIFY_SERVICE_SCHEMA.extend({ - vol.Optional(ATTR_TARGET): [TARGETS_SCHEMA], - vol.Optional(ATTR_DATA, default={}): MESSAGE_DATA_SCHEMA -}) - def get_service(hass, config, discovery_info=None): """Get the Hangouts notification service.""" @@ -61,8 +55,9 @@ class HangoutsNotificationService(BaseNotificationService): service_data = { ATTR_TARGET: target_conversations, ATTR_MESSAGE: messages, - ATTR_DATA: kwargs[ATTR_DATA] } + if kwargs[ATTR_DATA]: + service_data[ATTR_DATA] = kwargs[ATTR_DATA] return self.hass.services.call( DOMAIN, SERVICE_SEND_MESSAGE, service_data=service_data)