Gracefully handle additional GSM errors (#54114)

This commit is contained in:
Oscar Calvo 2021-08-06 03:18:29 -07:00 committed by GitHub
parent 1cc3ffe20d
commit 19adce844c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,10 @@ class Gateway:
await self._worker.set_incoming_sms_async()
except gammu.ERR_NOTSUPPORTED:
_LOGGER.warning("Your phone does not support incoming SMS notifications!")
except gammu.GSMError:
_LOGGER.warning(
"GSM error, your phone does not support incoming SMS notifications!"
)
else:
await self._worker.set_incoming_callback_async(self.sms_callback)