notifier: Add paused and resumed events to notifier

So we can tell when our printers need our attention. 

Signed-off-by: Josh Jones (vertigo235) <jbjonesclt@gmail.com>
This commit is contained in:
vertigo235 2022-03-02 16:11:23 -05:00 committed by Eric Callahan
parent 94c51c9412
commit 26d6ca009a
2 changed files with 12 additions and 0 deletions

View File

@ -1702,6 +1702,8 @@ events: *
# complete
# error
# cancelled
# paused
# resumed
body: "Your printer status has changed to {event_name}"
# The body of the notification. This option accepts Jinja2 templates.
# You can use {event_name} to print the current event trigger name. And {event_args} for

View File

@ -75,6 +75,16 @@ class Notifier:
"job_state:cancelled",
config)
self.events["paused"] = NotifierEvent(
"paused",
"job_state:paused",
config)
self.events["resumed"] = NotifierEvent(
"resumed",
"job_state:resumed",
config)
class NotifierEvent:
def __init__(self, identifier: str, event_name: str, config: ConfigHelper):