mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 12:45:28 +02:00
Support send SMS using GSM alphabet (#76834)
* Fix #76283 Fix #76283 * Update notify.py * Load SMS via discovery * Put back send as ANSI
This commit is contained in:
@@ -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"},
|
||||||
|
@@ -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:
|
||||||
|
Reference in New Issue
Block a user