From 8cd04750fcd68c64d4f6e4d2ff4dcdd98a90511e Mon Sep 17 00:00:00 2001 From: Oscar Calvo <2091582+ocalvo@users.noreply.github.com> Date: Mon, 22 Aug 2022 01:22:43 -0600 Subject: [PATCH] Support send SMS using GSM alphabet (#76834) * Fix #76283 Fix #76283 * Update notify.py * Load SMS via discovery * Put back send as ANSI --- homeassistant/components/sms/const.py | 1 + homeassistant/components/sms/notify.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sms/const.py b/homeassistant/components/sms/const.py index 858e53d9808..841c4bd8f89 100644 --- a/homeassistant/components/sms/const.py +++ b/homeassistant/components/sms/const.py @@ -13,6 +13,7 @@ NETWORK_COORDINATOR = "network_coordinator" GATEWAY = "gateway" DEFAULT_SCAN_INTERVAL = 30 CONF_BAUD_SPEED = "baud_speed" +CONF_UNICODE = "unicode" DEFAULT_BAUD_SPEED = "0" DEFAULT_BAUD_SPEEDS = [ {"value": DEFAULT_BAUD_SPEED, "label": "Auto"}, diff --git a/homeassistant/components/sms/notify.py b/homeassistant/components/sms/notify.py index 21b48946f55..d82e4951c00 100644 --- a/homeassistant/components/sms/notify.py +++ b/homeassistant/components/sms/notify.py @@ -8,7 +8,7 @@ from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationSer from homeassistant.const import CONF_NAME, CONF_RECIPIENT, CONF_TARGET import homeassistant.helpers.config_validation as cv -from .const import DOMAIN, GATEWAY, SMS_GATEWAY +from .const import CONF_UNICODE, DOMAIN, GATEWAY, SMS_GATEWAY _LOGGER = logging.getLogger(__name__) @@ -47,9 +47,10 @@ class SMSNotificationService(BaseNotificationService): gateway = self.hass.data[DOMAIN][SMS_GATEWAY][GATEWAY] targets = kwargs.get(CONF_TARGET, [self.number]) + is_unicode = kwargs.get(CONF_UNICODE, True) smsinfo = { "Class": -1, - "Unicode": True, + "Unicode": is_unicode, "Entries": [{"ID": "ConcatenatedTextLong", "Buffer": message}], } try: