Skip to content

Commit

Permalink
Merge pull request #20 from mrjones-plip/fix-gotify-alerts-18
Browse files Browse the repository at this point in the history
tidy up alert msg
  • Loading branch information
mrjones-plip authored Sep 5, 2024
2 parents 2b056e0 + d69d39c commit aad274f
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 aad274f

Please sign in to comment.