Diff title for script statuses
This commit is contained in:
parent
dfc779be26
commit
f76a8021e5
@ -28,6 +28,10 @@ def notify(message):
|
|||||||
api_url = 'https://hass.jennett-wheeler.co.uk/api/webhook/-Qx6jHsGLHwbBlJpLek5Nj8qS'
|
api_url = 'https://hass.jennett-wheeler.co.uk/api/webhook/-Qx6jHsGLHwbBlJpLek5Nj8qS'
|
||||||
requests.post(api_url, json={"title": "Monitor Planning", "message": message})
|
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():
|
def update_other_applications():
|
||||||
print("Scrape Weekly List(s)")
|
print("Scrape Weekly List(s)")
|
||||||
|
|
||||||
@ -68,7 +72,7 @@ def update_other_applications():
|
|||||||
return there_were_newly_decided_applications
|
return there_were_newly_decided_applications
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
notify(f"Script Started")
|
notify_status(f"Script Started")
|
||||||
try:
|
try:
|
||||||
with sqlite3.connect("./database.db") as connection:
|
with sqlite3.connect("./database.db") as connection:
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
@ -121,7 +125,7 @@ if __name__ == '__main__':
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f'Error found: {repr(e)}')
|
print(f'Error found: {repr(e)}')
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
notify(f"Error in planning monitor: {repr(e)}")
|
notify_status(f"Error in planning monitor: {repr(e)}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sys.exit(130)
|
sys.exit(130)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user