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:
parent
94c51c9412
commit
26d6ca009a
|
@ -1702,6 +1702,8 @@ events: *
|
||||||
# complete
|
# complete
|
||||||
# error
|
# error
|
||||||
# cancelled
|
# cancelled
|
||||||
|
# paused
|
||||||
|
# resumed
|
||||||
body: "Your printer status has changed to {event_name}"
|
body: "Your printer status has changed to {event_name}"
|
||||||
# The body of the notification. This option accepts Jinja2 templates.
|
# 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
|
# You can use {event_name} to print the current event trigger name. And {event_args} for
|
||||||
|
|
|
@ -75,6 +75,16 @@ class Notifier:
|
||||||
"job_state:cancelled",
|
"job_state:cancelled",
|
||||||
config)
|
config)
|
||||||
|
|
||||||
|
self.events["paused"] = NotifierEvent(
|
||||||
|
"paused",
|
||||||
|
"job_state:paused",
|
||||||
|
config)
|
||||||
|
|
||||||
|
self.events["resumed"] = NotifierEvent(
|
||||||
|
"resumed",
|
||||||
|
"job_state:resumed",
|
||||||
|
config)
|
||||||
|
|
||||||
|
|
||||||
class NotifierEvent:
|
class NotifierEvent:
|
||||||
def __init__(self, identifier: str, event_name: str, config: ConfigHelper):
|
def __init__(self, identifier: str, event_name: str, config: ConfigHelper):
|
||||||
|
|
Loading…
Reference in New Issue