Fix a bug where SMS will not be sent as GSM-alphabet (#78800)

* Fix #76283

Fix #76283

* Update notify.py

* Fixes a bug where unicode parameter is not parssed correctly

* Apply PR feedback

* Apply PR feedback
This commit is contained in:
Oscar Calvo 2022-09-25 00:43:46 -06:00 committed by GitHub
parent fffa70a136
commit b4b892a3b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,