diff --git a/homeassistant/components/sms/notify.py b/homeassistant/components/sms/notify.py index 13f9cfc9f72..71ec04c5ef1 100644 --- a/homeassistant/components/sms/notify.py +++ b/homeassistant/components/sms/notify.py @@ -3,7 +3,7 @@ import logging import gammu # pylint: disable=import-error -from homeassistant.components.notify import BaseNotificationService +from homeassistant.components.notify import ATTR_DATA, BaseNotificationService from homeassistant.const import CONF_TARGET from .const import CONF_UNICODE, DOMAIN, GATEWAY, SMS_GATEWAY @@ -42,7 +42,14 @@ class SMSNotificationService(BaseNotificationService): _LOGGER.error("No target number specified, cannot send message") return - is_unicode = kwargs.get(CONF_UNICODE, True) + extended_data = kwargs.get(ATTR_DATA) + _LOGGER.debug("Extended data:%s", extended_data) + + if extended_data is None: + is_unicode = True + else: + is_unicode = extended_data.get(CONF_UNICODE, True) + smsinfo = { "Class": -1, "Unicode": is_unicode,