From 6cc0a5ae34b5ddcc9b91e504405bcd964cce8aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 30 Jun 2020 17:53:08 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Docs=20for=20Action=20Command=20?= =?UTF-8?q?Notification=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action_command_notification.rst | 61 +++++++++++++++++++ docs/bundledplugins/index.rst | 1 + 2 files changed, 62 insertions(+) create mode 100644 docs/bundledplugins/action_command_notification.rst diff --git a/docs/bundledplugins/action_command_notification.rst b/docs/bundledplugins/action_command_notification.rst new file mode 100644 index 000000000..aff4d75be --- /dev/null +++ b/docs/bundledplugins/action_command_notification.rst @@ -0,0 +1,61 @@ +.. _sec-bundledplugins-action_command_notification: + +Action Command Notification support +=================================== + +The OctoPrint Action Command Notification Support Plugin comes bundled with OctoPrint (starting with 1.4.1). + +It allows firmware to trigger notifications users with the ``PLUGIN_ACTION_COMMAND_NOTIFICATION_SHOW`` permission +using :ref:`action commands ` about relevant events. These notifications will be shown +in the sidebar and if configured also as popup messages. The notifications in the sidebar panel can also be cleared +by users with the ``PLUGIN_ACTION_COMMAND_NOTIFICATION_CLEAR` permission. + +.. _fig-bundledplugins-action_command_notification-example: +.. figure:: ../images/bundledplugins-action_command_notification-example.png + :align: center + :alt: Simple notification example + + A simple notification example triggered by the firmware + +.. _sec-bundledplugins-action_command_notification-configuration: + +Configuring the plugin +---------------------- + +The plugin supports the following configuration keys: + + * ``enable``: Whether to enable the support of notifications (enabled by default). + * ``enable_popup``: Whether to enable the additional display of notifications as popups in the UI (disabled by default). + +You can modify them either through the plugin's configuration dialog under Settings, or by directly editing ``config.yaml``. + +.. _sec-bundledplugins-action_command_notification-action_commands: + +Supported action commands +------------------------- + +notification + Displays the notification ```` + +.. _sec-bundledplugins-action_command_prompt-example: + +Example communication with the firmware +--------------------------------------- + +.. _sec-bundledplugins-action_command_prompt-sourcecode: + +To display the :ref:`above notification ` the firmware sent this action command: + +.. code-block:: none + + //action:notification Hello World! + + +.. _sec-bundledplugins-action_command_notification-sourcecode: + + +Source code +----------- + +The source of the Action Command Prompt Notification plugin is bundled with OctoPrint and can be found in +its source repository under ``src/octoprint/plugins/action_command_notification``. diff --git a/docs/bundledplugins/index.rst b/docs/bundledplugins/index.rst index 206aaab57..fb838389b 100644 --- a/docs/bundledplugins/index.rst +++ b/docs/bundledplugins/index.rst @@ -7,6 +7,7 @@ Bundled Plugins .. toctree:: :maxdepth: 2 + action_command_notification.rst action_command_prompt.rst announcements.rst tracking.rst