Skip to content

Regenerate rules from templates #4718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Nadahar
Copy link
Contributor

@Nadahar Nadahar commented Apr 11, 2025

Regenerate rules from templates

Provide the ability to regenerate template based rules.

Description

Currently, template based rules must be deleted and recreated from the same template if the template is updated or if there is a need to change some of the configuration parameters (like linking the rule to a different Item). This PR provides the base functionality to enable regeneration of rules without having to delete and recreate them.

This PR alone won't do much, it will only enable the required functionality through the REST API. A companion PR will be posted for MainUI that will make use of the provided functionality.

This does contain a small change to the API in that RuleRegistry implementations must also implement regenerateFromTemplate, although if no template support is required for the RuleRegistry implementation, the method can be blank. This PR will require an update to any RuleRegistry implementations that exist outside of Core.

Ravi Nadahar added 4 commits April 11, 2025 20:12
@Nadahar
Copy link
Contributor Author

Nadahar commented May 21, 2025

I've created openhab/openhab-addons#18705 which should be merged if this is merged. It handles the small change to RuleRegistry this PR imposes. I've built the complete add-ons repo against this PR, and there seem to be no other issues.

@Nadahar
Copy link
Contributor Author

Nadahar commented May 23, 2025

I have created two "companion PRs" that should go together with this:

openhab/openhab-addons#18705

openhab/openhab-webui#3197

The add-ons PR only modified one official add-on to accommodate the small change to RuleRegistry for this PR, it was the only problem I could find among all the official add-ons.

The UI PR makes the functionality for which this PR lays the foundation actually available to users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant