@@ -355,12 +355,7 @@ def gps(self):
355355
356356 @gps .setter
357357 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 ):
364359 raise TypeError ("GPS unsupported for this FONA module." )
365360
366361 # check if already enabled or disabled
@@ -466,7 +461,7 @@ def send_sms(self, phone_number, message):
466461 # write out message and ^z
467462 self ._uart_write ((message + chr (26 )).encode ())
468463
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 ) :
470465 self ._read_line (200 ) # eat first 'CRLF'
471466 self ._read_line (200 ) # eat second 'CRLF'
472467
@@ -526,7 +521,7 @@ def delete_all_sms(self):
526521 if not self ._send_check_reply (b"AT+CMGF=1" , reply = REPLY_OK ):
527522 return False
528523
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 ) :
530525 num_sms = self .num_sms ()
531526 for slot in range (0 , num_sms ):
532527 if not self .delete_sms (slot ):
@@ -742,7 +737,7 @@ def socket_close(self, sock_num):
742737 self ._uart_write (b"AT+CIPCLOSE=" + str (sock_num ).encode () + b"\r \n " )
743738 self ._read_line (3000 )
744739
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 ) :
746741 if not self ._expect_reply (REPLY_OK ):
747742 return False
748743 else :
0 commit comments