From 737db0f129081459f60b307cc362f499c1ac1032 Mon Sep 17 00:00:00 2001 From: Mohamed Belhsan Hmida Date: Tue, 10 Nov 2026 16:38:07 +0100 Subject: [PATCH 1/3] Create plugin automation types from the automations page The creation form offered only the built-in types, so plugin types could only be created with the CLI or API. It now lists each installed plugin type under Plugin types, hides the data generator class field for them, and narrows the data source picker to the sources their generator records under. A Copy of a plugin automation now keeps its type and data source too. Signed-off-by: Mohamed Belhsan Hmida --- documentation/features/automations.rst | 5 +- .../templates/assets/asset_automations.html | 38 ++++++++++--- .../ui/tests/js/test_automation_actions.py | 10 ++++ .../ui/tests/js/test_automation_copy.py | 55 ++++++++++++++++++- .../tests/js/test_automation_source_picker.py | 3 + flexmeasures/ui/tests/test_asset_crud.py | 24 ++++++++ flexmeasures/ui/views/assets/views.py | 11 ++++ 7 files changed, 133 insertions(+), 13 deletions(-) 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/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
-
+ +