Fix a bug where a single long sms message is sent as multiple… (#34508)

This commit is contained in:
Oscar Calvo 2020-04-21 12:03:15 -07:00 committed by GitHub
parent 0d598dd6d6
commit b73c774b07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,15 +48,11 @@ class SMSNotificationService(BaseNotificationService):
# Send messages # Send messages
for encoded_message in encoded: for encoded_message in encoded:
# Prepare message data # Fill in numbers
gammu_message = { encoded_message["SMSC"] = {"Location": 1}
"Text": encoded_message["Text"], encoded_message["Number"] = self.number
# We tell that we want to use first SMSC number stored in phone
"SMSC": {"Location": 1},
"Number": self.number,
}
try: try:
# Actually send the message # Actually send the message
self.gateway.SendSMS(gammu_message) self.gateway.SendSMS(encoded_message)
except gammu.GSMError as exc: # pylint: disable=no-member except gammu.GSMError as exc: # pylint: disable=no-member
_LOGGER.error("Sending to %s failed: %s", self.number, exc) _LOGGER.error("Sending to %s failed: %s", self.number, exc)