mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-26 20:21:33 +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) {
|
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());
|
RuleBuilder builder = RuleBuilder.create(element.getUID());
|
||||||
|
|
||||||
String name = element.getName();
|
String name = element.getName();
|
||||||
@ -173,7 +181,6 @@ public class ScriptedAutomationManager {
|
|||||||
|
|
||||||
Rule rule = builder.build();
|
Rule rule = builder.build();
|
||||||
|
|
||||||
ruleRegistryDelegate.add(rule);
|
|
||||||
return rule;
|
return rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user