From 26d6ca009aadd6592b043351080da180dca4b331 Mon Sep 17 00:00:00 2001 From: vertigo235 Date: Wed, 2 Mar 2022 16:11:23 -0500 Subject: [PATCH] notifier: Add paused and resumed events to notifier So we can tell when our printers need our attention. Signed-off-by: Josh Jones (vertigo235) --- docs/configuration.md | 2 ++ moonraker/components/notifier.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 557ebca..05a7250 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -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 diff --git a/moonraker/components/notifier.py b/moonraker/components/notifier.py index 1025e7e..3e5ec48 100644 --- a/moonraker/components/notifier.py +++ b/moonraker/components/notifier.py @@ -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):