mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-11 05:41:52 +01:00
Add ability for scripts to create unmanaged rules (#1897)
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
This commit is contained in:
parent
f0c9a8434d
commit
f1a3d824ac
@ -106,6 +106,14 @@ public class ScriptedAutomationManager {
|
||||
}
|
||||
|
||||
public Rule addRule(Rule element) {
|
||||
Rule rule = addUnmanagedRule(element);
|
||||
|
||||
ruleRegistryDelegate.add(rule);
|
||||
|
||||
return rule;
|
||||
}
|
||||
|
||||
public Rule addUnmanagedRule(Rule element) {
|
||||
RuleBuilder builder = RuleBuilder.create(element.getUID());
|
||||
|
||||
String name = element.getName();
|
||||
@ -173,7 +181,6 @@ public class ScriptedAutomationManager {
|
||||
|
||||
Rule rule = builder.build();
|
||||
|
||||
ruleRegistryDelegate.add(rule);
|
||||
return rule;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user