mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
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:
parent
fffa70a136
commit
b4b892a3b3
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user