Support send SMS using GSM alphabet (#76834)

* Fix #76283

Fix #76283

* Update notify.py

* Load SMS via discovery

* Put back send as ANSI
pull/77016/head
Oscar Calvo 2022-08-22 01:22:43 -06:00 committed by GitHub
parent 1940d9a377
commit 8cd04750fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -13,6 +13,7 @@ NETWORK_COORDINATOR = "network_coordinator"
GATEWAY = "gateway" GATEWAY = "gateway"
DEFAULT_SCAN_INTERVAL = 30 DEFAULT_SCAN_INTERVAL = 30
CONF_BAUD_SPEED = "baud_speed" CONF_BAUD_SPEED = "baud_speed"
CONF_UNICODE = "unicode"
DEFAULT_BAUD_SPEED = "0" DEFAULT_BAUD_SPEED = "0"
DEFAULT_BAUD_SPEEDS = [ DEFAULT_BAUD_SPEEDS = [
{"value": DEFAULT_BAUD_SPEED, "label": "Auto"}, {"value": DEFAULT_BAUD_SPEED, "label": "Auto"},

View File

@ -8,7 +8,7 @@ from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationSer
from homeassistant.const import CONF_NAME, CONF_RECIPIENT, CONF_TARGET from homeassistant.const import CONF_NAME, CONF_RECIPIENT, CONF_TARGET
import homeassistant.helpers.config_validation as cv 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__) _LOGGER = logging.getLogger(__name__)
@ -47,9 +47,10 @@ class SMSNotificationService(BaseNotificationService):
gateway = self.hass.data[DOMAIN][SMS_GATEWAY][GATEWAY] gateway = self.hass.data[DOMAIN][SMS_GATEWAY][GATEWAY]
targets = kwargs.get(CONF_TARGET, [self.number]) targets = kwargs.get(CONF_TARGET, [self.number])
is_unicode = kwargs.get(CONF_UNICODE, True)
smsinfo = { smsinfo = {
"Class": -1, "Class": -1,
"Unicode": True, "Unicode": is_unicode,
"Entries": [{"ID": "ConcatenatedTextLong", "Buffer": message}], "Entries": [{"ID": "ConcatenatedTextLong", "Buffer": message}],
} }
try: try: