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:
lolodomo
2026-04-12 20:18:26 +02:00
committed by GitHub
parent 59ab51e17d
commit 4623a78443
2 changed files with 4 additions and 7 deletions
@@ -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;
}
@@ -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) {