diff --git a/docs/features/custom_controls.rst b/docs/features/custom_controls.rst index fa69cc435..ad8756bbe 100644 --- a/docs/features/custom_controls.rst +++ b/docs/features/custom_controls.rst @@ -213,17 +213,28 @@ Controls - (Optional) A :ref:`regular expression ` to match against lines received from the printer to retrieve information from it (e.g. specific output). Together with ``template`` this allows rendition of received data from the printer within the UI. + + **Please also read the note below**. * - ``template`` - (Optional) A template to use for rendering the match of ``regex``. May contain placeholders in :ref:`Python Format String Syntax ` for either named groups within the regex (e.g. ``Temperature: {temperature}`` for a regex ``T:\s*(?P\d+(\.\d*)``) or positional groups within the regex (e.g. ``Position: X={0}, Y={1}, Z={2}, E={3}`` for a regex ``X:([0-9.]+) Y:([0-9.]+) Z:([0-9.]+) E:([0-9.]+)``). + + **Please also read the note below**. * - ``confirm`` - (Optional) A text to display to the user to confirm his button press. Can be used with sensitive custom controls like changing EEPROM values in order to prevent accidental clicks. The text will be displayed in a confirmation dialog like in :numref:`fig-configuration-customcontrols-confirm`. +.. note:: + + ``regex`` and ``template`` are only supported for controls that are defined through + ``config.yaml``. These control properties aren't supported for controls added only in + the frontend by the :ref:`getAdditionalControls ` + view model callback. + .. _fig-configuration-customcontrols-confirm: .. figure:: ../images/features-custom_controls-confirm.png :align: center diff --git a/docs/plugins/viewmodels.rst b/docs/plugins/viewmodels.rst index 33d28e9a8..dc8d9cace 100644 --- a/docs/plugins/viewmodels.rst +++ b/docs/plugins/viewmodels.rst @@ -238,6 +238,11 @@ getAdditionalControls() Your view model may return additional custom control definitions for inclusion on the "Control" tab of OctoPrint's interface. See :ref:`the custom control feature`. + .. note:: + + Controls injected from a view model do not support feedback controls (as defined by + ``regex`` and ``template``). + onSettingsShown() Called when the settings dialog is shown.