Skip to content

Commit

Permalink
tidy up alert msg per #18
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones-plip committed Sep 5, 2024
1 parent 0ec9911 commit d69d39c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d69d39c

Please sign in to comment.