This commit is contained in:
Your Name
2025-03-20 10:54:41 +01:00
parent 4d15076d4b
commit 5b7de91d50
2 changed files with 2 additions and 6 deletions

View File

@@ -613,19 +613,13 @@ try:
# Send notification
try:
# Format the URL with the device_id
alert_url = f'http://data.nebuleair.fr/pro_4G/alert.php?capteur_id={device_id}&error_type=serial_error'
# Send POST request with short timeout
response = requests.post(alert_url, timeout=3)
if response.status_code == 200:
print(f"Alert notification sent successfully")
else:
print(f"Alert notification failed with status code: {response.status_code}")
except Exception as e:
# Catch any exception and continue
print(f"Alert notification failed: {e}")
#end loop