From 800cf62d0434f072e02c42bb35e1ffec322e7758 Mon Sep 17 00:00:00 2001 From: Pavel Valach Date: Tue, 2 Feb 2021 11:58:22 +0100 Subject: [PATCH] modem.State does not work :/ --- check_modem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_modem.py b/check_modem.py index 2961eff..cae4da8 100755 --- a/check_modem.py +++ b/check_modem.py @@ -56,7 +56,7 @@ if __name__ == "__main__": print(status) # return code: if registered and signal > 0, return 0 - if modem.State in [ MM_MODEM_STATE_REGISTERED, MM_MODEM_STATE_CONNECTED ] and modem.SignalQuality[0] > 0 and modem.RegistrationState == 1: + if modem.GetStatus()["state"] in [ MM_MODEM_STATE_REGISTERED, MM_MODEM_STATE_CONNECTED ] and modem.SignalQuality[0] > 0 and modem.RegistrationState == 1: exit(0) else: exit(1)