mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Fix how is called withTags in DSL Rule file provider (#5463)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
+2
-1
@@ -14,6 +14,7 @@ package org.openhab.core.automation.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -159,7 +160,7 @@ public class RuleBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public RuleBuilder withTags(@Nullable Set<String> tags) {
|
||||
public RuleBuilder withTags(@Nullable Collection<String> tags) {
|
||||
this.tags = tags != null ? Set.copyOf(tags) : Set.of();
|
||||
return this;
|
||||
}
|
||||
|
||||
+2
-6
@@ -19,7 +19,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -308,11 +307,8 @@ public class DSLRuleProvider
|
||||
List<Action> actions = List.of(ActionBuilder.create().withId("script").withTypeUID(ScriptActionHandler.TYPE_ID)
|
||||
.withConfiguration(cfg).build());
|
||||
|
||||
List<String> ruleTags = rule.getTags();
|
||||
Set<String> tags = ruleTags == null ? Set.of() : Set.copyOf(ruleTags);
|
||||
|
||||
return RuleBuilder.create(uid).withTags(tags).withName(name).withTriggers(triggers).withActions(actions)
|
||||
.withConditions(conditions).build();
|
||||
return RuleBuilder.create(uid).withTags(rule.getTags()).withName(name).withTriggers(triggers)
|
||||
.withActions(actions).withConditions(conditions).build();
|
||||
}
|
||||
|
||||
private String removeIndentation(String script) {
|
||||
|
||||
Reference in New Issue
Block a user