From d69d39c520f0a0fc71945e2156eca95f70aa97c9 Mon Sep 17 00:00:00 2001 From: mrjones-plip Date: Wed, 4 Sep 2024 21:24:52 -0700 Subject: [PATCH] tidy up alert msg per #18 --- main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 981d2ae..63525e7 100644 --- a/main.py +++ b/main.py @@ -22,10 +22,11 @@ def send_alert(user, action, seconds, computer, ssh): try: usage = get_usage(user, computer, ssh) added = humanize.naturaldelta(seconds) - remain = humanize.precisedelta(usage['time_left']) + unused = humanize.precisedelta(usage['time_left']) + used = humanize.precisedelta(usage['time_spent']) result = gotify.create_message( - f"{action} {added}, {remain} remaining :)", - title=f"Timekpr: {user} {action} {added}", + f"{action} {added}, {unused} unused, {used} used :)", + title=f"Timekpr: {user} {action} time", priority=2, ) except Exception as e: