openhab / openhab-js

openHAB JavaScript Library for JavaScript Scripting Automation
https://www.openhab.org/addons/automation/jsscripting/
Eclipse Public License 2.0
38 stars 31 forks source link

[WIP] [rules] Add support for displaying the code in MainUI #173

Closed florian-h05 closed 1 year ago

florian-h05 commented 1 year ago

Fixes https://github.com/openhab/openhab-addons/issues/12929.

Description

With this PR, the JSRule API adds additional information to the rule‘s action, so that MainUI is able to display a rule‘s source code. Due to the lack of direct access to the rules source code, a utility function is used to regenerate the source code from the given rule configuration. Therefore, the generated code does not work for the RuleBuilder API, as this is using JSRule under the hood.

Testing

This PR requires additional testing from my side, as well as an update of the type defintions.

florian-h05 commented 1 year ago

Replaced by #199.