add new filter to sms

This commit is contained in:
2022-03-10 09:18:37 +01:00
parent 4f7b05913c
commit 22e3e63895
+3
View File
@@ -110,6 +110,7 @@ def handle_sms(sms):
date = str(sms.time)[0:10]
if date == str(datetime.date.today()):
logger.info("this sms is for today")
if "rendez-vous" in sms.text:
logger.info("try to extract the otp")
pattern = r'\d{6,8}'
# if re.match(pattern, sms.text):
@@ -126,6 +127,8 @@ def handle_sms(sms):
if current_gsm_modem:
logger.info("will close used modem")
current_gsm_modem.close()
else:
logger.info("the sms is not for RDV")
else:
logger.info("the sms is not for today")