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 <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2021-06-22 19:31:51 -04:00
parent 331be63c9e
commit 06bbca7ae3
1 changed files with 4 additions and 0 deletions

View File

@ -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