peut prendre RDV automatiquement
This commit is contained in:
Binary file not shown.
+2
-1
@@ -19,7 +19,8 @@ class ExcelReader:
|
||||
last_name=last_name,
|
||||
first_name=first_name,
|
||||
ccid=contact_dict['ccid'],
|
||||
passport_number=contact_dict['passport'], mail=contact_dict['email'])
|
||||
passport_number=contact_dict['passport'],
|
||||
mail=contact_dict['email'])
|
||||
contact_list.append(contact)
|
||||
return contact_list
|
||||
|
||||
|
||||
@@ -12,8 +12,9 @@ from pojo.serial_modem import SerialModem
|
||||
from utils.logging import init_logger
|
||||
|
||||
BAUDRATE = 115200
|
||||
OTP_TIMEOUT = 120
|
||||
OTP_TIMEOUT = 60
|
||||
sms_received = False
|
||||
commandor = Commandor()
|
||||
|
||||
|
||||
def get_devices_ports() -> list:
|
||||
@@ -94,13 +95,17 @@ def start_to_handle_sms(serial_modem: SerialModem):
|
||||
|
||||
|
||||
def handle_sms(sms):
|
||||
logger.info(u'== SMS message received ==\nFrom: {0}\nTime: {1}\nMessage:\n{2}\n'.format(sms.number, sms.time, sms.text))
|
||||
global sms_received
|
||||
sms_received = True
|
||||
logger.info(
|
||||
u'== SMS message received ==\nFrom: {0}\nTime: {1}\nMessage:\n{2}\n'.format(sms.number, sms.time, sms.text))
|
||||
# extract the otp number
|
||||
logger.info("try to extract the otp")
|
||||
match = re.search(r'\d{6,8}', sms.text)
|
||||
logger.info("otp is " + match.group(0))
|
||||
otp = match.group(0)
|
||||
logger.info("otp is " + otp)
|
||||
commandor.send_otp(otp)
|
||||
time.sleep(20)
|
||||
global sms_received
|
||||
sms_received = True
|
||||
|
||||
|
||||
def init_modems() -> list:
|
||||
@@ -125,5 +130,7 @@ if __name__ == '__main__':
|
||||
# create modems for all the available port
|
||||
modem_list = init_modems()
|
||||
# create listeners for chaque modem
|
||||
|
||||
for modem in modem_list:
|
||||
commandor.start_page(modem.contact)
|
||||
start_to_handle_sms(modem)
|
||||
|
||||
Reference in New Issue
Block a user