Skip to content

Commit 82b3990

Browse files
committed
fixes based on reviewer suggestions
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
1 parent 2aea9a6 commit 82b3990

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/link/ItemChannelLinkRegistry.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
public class ItemChannelLinkRegistry extends AbstractLinkRegistry<ItemChannelLink, ItemChannelLinkProvider>
6767
implements RegistryChangeListener<Item> {
6868

69-
public static final String USE_TAGS = "useTags";
69+
public static final String USE_TAGS = "applyChannelTagsToItem";
7070

7171
private final Logger logger = LoggerFactory.getLogger(ItemChannelLinkRegistry.class);
7272

@@ -291,8 +291,10 @@ private void assignChannelDefaultTags(ItemChannelLink link, ActiveItem activeIte
291291
Set<String> channelDefaultTags = getChannelDefaultTags(link);
292292
if (!channelDefaultTags.isEmpty()) {
293293
if (alreadyHasPointOrPropertyTag) {
294-
logger.warn("Item '{}' already tagged; forbidden to assign tags from channel '{}'.",
295-
activeItem.getName(), link.getLinkedUID());
294+
if (!useTagsGlobally) {
295+
logger.warn("Item '{}' already tagged; forbidden to assign tags from channel '{}'.",
296+
activeItem.getName(), link.getLinkedUID());
297+
}
296298
} else {
297299
Set<String> newTags = new HashSet<>(activeItem.getTags());
298300
newTags.addAll(channelDefaultTags);
@@ -337,8 +339,10 @@ private void removeChannelDefaultTags(ItemChannelLink oldLink, ActiveItem active
337339
Set<String> otherLinkTags = getChannelDefaultTags(otherLink);
338340
if (!otherLinkTags.isEmpty()) {
339341
if (alreadyHasPointOrPropertyTag) {
340-
logger.warn("Item '{}' already tagged; forbidden to assign tags from channel '{}'.",
341-
activeItem.getName(), otherLink.getLinkedUID());
342+
if (!useTagsGlobally) {
343+
logger.warn("Item '{}' already tagged; forbidden to assign tags from channel '{}'.",
344+
activeItem.getName(), otherLink.getLinkedUID());
345+
}
342346
break;
343347
} else {
344348
alreadyHasPointOrPropertyTag = true;

0 commit comments

Comments
 (0)