Merge remote-tracking branch 'refs/remotes/origin/main'
This commit is contained in:
@@ -612,19 +612,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
|
||||
|
||||
Reference in New Issue
Block a user