@@ -355,12 +355,7 @@ def gps(self):
355
355
356
356
@gps .setter
357
357
def gps (self , gps_on = False ):
358
- if not (
359
- self ._fona_type == FONA_3G_A
360
- or self ._fona_type == FONA_3G_E
361
- or self ._fona_type == FONA_808_V1
362
- or self ._fona_type == FONA_808_V2
363
- ):
358
+ if self ._fona_type not in (FONA_3G_A , FONA_3G_E , FONA_808_V1 , FONA_808_V2 ):
364
359
raise TypeError ("GPS unsupported for this FONA module." )
365
360
366
361
# check if already enabled or disabled
@@ -466,7 +461,7 @@ def send_sms(self, phone_number, message):
466
461
# write out message and ^z
467
462
self ._uart_write ((message + chr (26 )).encode ())
468
463
469
- if self ._fona_type == FONA_3G_A or self . _fona_type == FONA_3G_E :
464
+ if self ._fona_type in ( FONA_3G_A , FONA_3G_E ) :
470
465
self ._read_line (200 ) # eat first 'CRLF'
471
466
self ._read_line (200 ) # eat second 'CRLF'
472
467
@@ -526,7 +521,7 @@ def delete_all_sms(self):
526
521
if not self ._send_check_reply (b"AT+CMGF=1" , reply = REPLY_OK ):
527
522
return False
528
523
529
- if self ._fona_type == FONA_3G_A or self . _fona_type == FONA_3G_E :
524
+ if self ._fona_type in ( FONA_3G_A , FONA_3G_E ) :
530
525
num_sms = self .num_sms ()
531
526
for slot in range (0 , num_sms ):
532
527
if not self .delete_sms (slot ):
@@ -742,7 +737,7 @@ def socket_close(self, sock_num):
742
737
self ._uart_write (b"AT+CIPCLOSE=" + str (sock_num ).encode () + b"\r \n " )
743
738
self ._read_line (3000 )
744
739
745
- if self ._fona_type == FONA_3G_A or self . _fona_type == FONA_3G_E :
740
+ if self ._fona_type in ( FONA_3G_A , FONA_3G_E ) :
746
741
if not self ._expect_reply (REPLY_OK ):
747
742
return False
748
743
else :
0 commit comments