Add Shutdown Event

This commit is contained in:
Salandora 2016-01-15 12:56:19 +01:00
parent 86b96b8d4a
commit e1d58660d7
2 changed files with 2 additions and 0 deletions

View file

@ -26,6 +26,7 @@ def all_events():
class Events(object):
# application startup
STARTUP = "Startup"
SHUTDOWN = "Shutdown"
# connect/disconnect to printer
CONNECTING = "Connecting"

View file

@ -511,6 +511,7 @@ class Server():
self._logger.info("Shutting down...")
observer.stop()
observer.join()
eventManager.fire(events.Events.SHUTDOWN)
octoprint.plugin.call_plugin(octoprint.plugin.ShutdownPlugin,
"on_shutdown",
sorting_context="ShutdownPlugin.on_shutdown")