From 06bbca7ae39bf8533721c038b2b29c4ee6ea87bf Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Tue, 22 Jun 2021 19:31:51 -0400 Subject: [PATCH] moonraker: add method to set a component as failed Some components require post-load initialization after the IOLoop has started. Provide a method for these components to register a failure with the server. Signed-off-by: Eric Callahan --- moonraker/moonraker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/moonraker/moonraker.py b/moonraker/moonraker.py index f11e441..102affc 100755 --- a/moonraker/moonraker.py +++ b/moonraker/moonraker.py @@ -222,6 +222,10 @@ class Server: raise ServerError(f"Component ({component_name}) not found") return component + def set_failed_component(self, component_name: str) -> None: + if component_name not in self.failed_components: + self.failed_components.append(component_name) + def register_notification(self, event_name: str, notify_name: Optional[str] = None