diff --git a/documentation/changelog.rst b/documentation/changelog.rst index d0b81fdd04..eb6344baaf 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -11,6 +11,7 @@ v1.2.0 | December xx, 2026 New features ------------- +* Create automations of the types that installed plugins add from the *New automation* form on an asset's Automations page, not only from the CLI or the API [see `PR #2871 `_] Infrastructure / Support ------------------------- diff --git a/documentation/features/automations.rst b/documentation/features/automations.rst index 90c13b0a15..574b6e3e1b 100644 --- a/documentation/features/automations.rst +++ b/documentation/features/automations.rst @@ -187,8 +187,9 @@ Plugin schemas validate configuration and parameters, and unknown fields are rej Run a worker for the queue declared by the handler, in addition to the automation dispatcher. The UI lists registered plugin types in their own tabs and shows their parameters, data source, input sensors, output sensors and recent jobs. -Existing actions, including editing recurrence, activation, deletion and *Run now*, also apply to these automations. -Creation forms for plugin types are a follow-up: use the CLI or API to create them for now. +Existing actions, including editing recurrence, activation, deletion, *Copy* and *Run now*, also apply to these automations. +The *New automation* form offers each installed plugin type under *Plugin types*. +Fill in its configuration and parameters as JSON, or pick an existing data source of that type; the plugin's generator is used, so the form asks for no data generator. API-created automations remember the user who created them. The dispatcher and worker recheck that the user is active and can write to the output sensors. diff --git a/flexmeasures/cli/tests/test_plugin_automations.py b/flexmeasures/cli/tests/test_plugin_automations.py index 7b6121107c..1ccfbe7e74 100644 --- a/flexmeasures/cli/tests/test_plugin_automations.py +++ b/flexmeasures/cli/tests/test_plugin_automations.py @@ -139,9 +139,12 @@ def test_ui_inspects_custom_and_unavailable_type( assert "Measurements <script>" in response assert '' not in response assert r"\u003cscript\u003e" in response + # The creation form offers the installed type, under the escaped name its tab uses. + assert '' not in response def test_the_page_has_a_tab_for_a_type_it_can_come_to_list( diff --git a/flexmeasures/ui/templates/assets/asset_automations.html b/flexmeasures/ui/templates/assets/asset_automations.html index 3ddbb9285e..2959ee9c5f 100644 --- a/flexmeasures/ui/templates/assets/asset_automations.html +++ b/flexmeasures/ui/templates/assets/asset_automations.html @@ -170,12 +170,19 @@
@@ -213,7 +220,8 @@
Configuration
-
+ +