From ea8f624f288b3b0c7b4fb4f9b666b66be116ac1d Mon Sep 17 00:00:00 2001 From: Oscar Calvo <2091582+ocalvo@users.noreply.github.com> Date: Wed, 22 Sep 2021 21:49:08 -0700 Subject: [PATCH] Fix an issue where core process crashes when an SMS is received (#56552) --- homeassistant/components/sms/gateway.py | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/homeassistant/components/sms/gateway.py b/homeassistant/components/sms/gateway.py index 3034580d5e0..b88b81d1fb4 100644 --- a/homeassistant/components/sms/gateway.py +++ b/homeassistant/components/sms/gateway.py @@ -24,16 +24,6 @@ class Gateway: async def init_async(self): """Initialize the sms gateway asynchronously.""" await self._worker.init_async() - try: - await self._worker.set_incoming_sms_async() - except gammu.ERR_NOTSUPPORTED: - _LOGGER.warning("Falling back to pulling method for SMS notifications") - except gammu.GSMError: - _LOGGER.warning( - "GSM error, falling back to pulling method for SMS notifications" - ) - else: - await self._worker.set_incoming_callback_async(self.sms_callback) def sms_pull(self, state_machine): """Pull device. @@ -47,21 +37,6 @@ class Gateway: self.sms_read_messages(state_machine, self._first_pull) self._first_pull = False - def sms_callback(self, state_machine, callback_type, callback_data): - """Receive notification about incoming event. - - @param state_machine: state machine which invoked action - @type state_machine: gammu.StateMachine - @param callback_type: type of action, one of Call, SMS, CB, USSD - @type callback_type: string - @param data: event data - @type data: hash - """ - _LOGGER.debug( - "Received incoming event type:%s,data:%s", callback_type, callback_data - ) - self.sms_read_messages(state_machine) - def sms_read_messages(self, state_machine, force=False): """Read all received SMS messages.