From cd9aab7eef69a0abad711239a9d99fa4d19329db Mon Sep 17 00:00:00 2001 From: Levi Blaney Date: Tue, 5 Jan 2021 09:13:59 -0500 Subject: [PATCH] update docs with dynamic gcode events --- docs/events/index.rst | 28 ++++++++++++++++++++++++++++ docs/features/gcode_scripts.rst | 9 +++++++++ 2 files changed, 37 insertions(+) diff --git a/docs/events/index.rst b/docs/events/index.rst index 7fa5e733e..5407a4935 100644 --- a/docs/events/index.rst +++ b/docs/events/index.rst @@ -539,6 +539,34 @@ PrintResumed .. versionchanged:: 1.4.0 +${ScriptName}Running + A custom :ref:`GCODE script ` has started running. + + Payload: + + * ``name``: the file's name + * ``path``: the file's path within its storage location + * ``origin``: the origin storage location of the file, either ``local`` or ``sdcard`` + * ``size``: the file's size in bytes (if available) + * ``owner``: the user who started the print job (if available) + * ``time``: the time needed for the print, in seconds (float) + + .. versionadded:: X.X.X + +${ScriptName}Finished + A custom :ref:`GCODE script ` has finished running. + + Payload: + + * ``name``: the file's name + * ``path``: the file's path within its storage location + * ``origin``: the origin storage location of the file, either ``local`` or ``sdcard`` + * ``size``: the file's size in bytes (if available) + * ``owner``: the user who started the print job (if available) + * ``time``: the time needed for the print, in seconds (float) + + .. versionadded:: X.X.X + .. _sec-events-available_events-gcode_processing: GCODE processing diff --git a/docs/features/gcode_scripts.rst b/docs/features/gcode_scripts.rst index dbd84ef0d..a1c0d6167 100644 --- a/docs/features/gcode_scripts.rst +++ b/docs/features/gcode_scripts.rst @@ -43,6 +43,15 @@ The following GCODE scripts are sent by OctoPrint automatically: Plugins may extend these scripts through :ref:`a hook `. +.. _sec-features-gcode_scripts-events: + +Events +------ + +Every GCODE script that is executed will emit two events. The events will start with the capitalized name of the script. +When ``afterPrintDone`` has started the event will be ``AfterPrintDoneRunning`` and once it has completed the last event +will be ``AfterPrintDoneFinished``. You can find more details in the :ref:`Events ` documentation. + .. _sec-features-gcode_scripts-snippets: Snippets