Diff title for script statuses

This commit is contained in:
James Jennett-Wheeler 2025-06-25 10:25:41 +01:00
parent dfc779be26
commit f76a8021e5

View File

@ -28,6 +28,10 @@ def notify(message):
api_url = 'https://hass.jennett-wheeler.co.uk/api/webhook/-Qx6jHsGLHwbBlJpLek5Nj8qS'
requests.post(api_url, json={"title": "Monitor Planning", "message": message})
def notify_status(message):
api_url = 'https://hass.jennett-wheeler.co.uk/api/webhook/-Qx6jHsGLHwbBlJpLek5Nj8qS'
requests.post(api_url, json={"title": "Planning Script", "message": message})
def update_other_applications():
print("Scrape Weekly List(s)")
@ -68,7 +72,7 @@ def update_other_applications():
return there_were_newly_decided_applications
if __name__ == '__main__':
notify(f"Script Started")
notify_status(f"Script Started")
try:
with sqlite3.connect("./database.db") as connection:
cursor = connection.cursor()
@ -121,7 +125,7 @@ if __name__ == '__main__':
except Exception as e:
print(f'Error found: {repr(e)}')
print(traceback.format_exc())
notify(f"Error in planning monitor: {repr(e)}")
notify_status(f"Error in planning monitor: {repr(e)}")
try:
sys.exit(130)