mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Semantic Tags: Overload Equipment tag setters for Things (#4713)
* overload tag setter methods * run resolver Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
@@ -30,6 +30,11 @@
|
||||
<artifactId>org.openhab.core.transform</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openhab.core.bundles</groupId>
|
||||
<artifactId>org.openhab.core.semantics</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openhab.core.bundles</groupId>
|
||||
<artifactId>org.openhab.core.test</artifactId>
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.core.common.registry.Identifiable;
|
||||
import org.openhab.core.config.core.Configuration;
|
||||
import org.openhab.core.items.Item;
|
||||
import org.openhab.core.semantics.SemanticTag;
|
||||
import org.openhab.core.thing.binding.ThingHandler;
|
||||
|
||||
/**
|
||||
@@ -246,4 +247,6 @@ public interface Thing extends Identifiable<ThingUID> {
|
||||
* @param semanticEquipmentTag the semantic (equipment) tag or {@code null} if no tag has been configured.
|
||||
*/
|
||||
void setSemanticEquipmentTag(@Nullable String semanticEquipmentTag);
|
||||
|
||||
void setSemanticEquipmentTag(@Nullable SemanticTag semanticEquipmentTag);
|
||||
}
|
||||
|
||||
+6
@@ -18,6 +18,7 @@ import java.util.Map;
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.core.config.core.Configuration;
|
||||
import org.openhab.core.semantics.SemanticTag;
|
||||
import org.openhab.core.thing.Bridge;
|
||||
import org.openhab.core.thing.Channel;
|
||||
import org.openhab.core.thing.ChannelUID;
|
||||
@@ -128,4 +129,9 @@ public class BridgeBuilder extends ThingBuilder {
|
||||
public BridgeBuilder withSemanticEquipmentTag(@Nullable String semanticEquipmentTag) {
|
||||
return (BridgeBuilder) super.withSemanticEquipmentTag(semanticEquipmentTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BridgeBuilder withSemanticEquipmentTag(SemanticTag semanticEquipmentTag) {
|
||||
return withSemanticEquipmentTag(semanticEquipmentTag.getName());
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -23,6 +23,7 @@ import java.util.Objects;
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.core.config.core.Configuration;
|
||||
import org.openhab.core.semantics.SemanticTag;
|
||||
import org.openhab.core.thing.Channel;
|
||||
import org.openhab.core.thing.ChannelUID;
|
||||
import org.openhab.core.thing.Thing;
|
||||
@@ -265,6 +266,10 @@ public class ThingBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ThingBuilder withSemanticEquipmentTag(SemanticTag semanticEquipmentTag) {
|
||||
return withSemanticEquipmentTag(semanticEquipmentTag.getName());
|
||||
}
|
||||
|
||||
protected Thing populate(ThingImpl thing) {
|
||||
thing.setLabel(label);
|
||||
thing.setChannels(channels);
|
||||
|
||||
+6
@@ -20,6 +20,7 @@ import java.util.Map;
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.core.config.core.Configuration;
|
||||
import org.openhab.core.semantics.SemanticTag;
|
||||
import org.openhab.core.thing.Channel;
|
||||
import org.openhab.core.thing.ChannelUID;
|
||||
import org.openhab.core.thing.Thing;
|
||||
@@ -299,4 +300,9 @@ public class ThingImpl implements Thing {
|
||||
public void setSemanticEquipmentTag(@Nullable String semanticEquipmentTag) {
|
||||
this.semanticEquipmentTag = semanticEquipmentTag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSemanticEquipmentTag(@Nullable SemanticTag semanticEquipmentTag) {
|
||||
setSemanticEquipmentTag(semanticEquipmentTag.getName());
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -18,6 +18,7 @@ import java.util.Map;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.core.semantics.SemanticTag;
|
||||
import org.openhab.core.thing.ThingTypeUID;
|
||||
|
||||
/**
|
||||
@@ -207,4 +208,8 @@ public class ThingTypeBuilder {
|
||||
this.semanticEquipmentTag = semanticEquipmentTag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ThingTypeBuilder withSemanticEquipmentTag(SemanticTag semanticEquipmentTag) {
|
||||
return withSemanticEquipmentTag(semanticEquipmentTag.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,4 +82,5 @@ Fragment-Host: org.openhab.core.automation
|
||||
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.18.2,2.18.3)',\
|
||||
org.yaml.snakeyaml;version='[2.3.0,2.3.1)',\
|
||||
de.focus_shift.jollyday-core;version='[1.5.0,1.5.1)',\
|
||||
de.focus_shift.jollyday-jackson;version='[1.5.0,1.5.1)'
|
||||
de.focus_shift.jollyday-jackson;version='[1.5.0,1.5.1)',\
|
||||
org.openhab.core.semantics;version='[5.0.0,5.0.1)'
|
||||
|
||||
@@ -82,4 +82,5 @@ Fragment-Host: org.openhab.core.automation
|
||||
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.18.2,2.18.3)',\
|
||||
org.yaml.snakeyaml;version='[2.3.0,2.3.1)',\
|
||||
de.focus_shift.jollyday-core;version='[1.5.0,1.5.1)',\
|
||||
de.focus_shift.jollyday-jackson;version='[1.5.0,1.5.1)'
|
||||
de.focus_shift.jollyday-jackson;version='[1.5.0,1.5.1)',\
|
||||
org.openhab.core.semantics;version='[5.0.0,5.0.1)'
|
||||
|
||||
@@ -79,4 +79,5 @@ Fragment-Host: org.openhab.core.automation.module.script
|
||||
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.18.2,2.18.3)',\
|
||||
org.yaml.snakeyaml;version='[2.3.0,2.3.1)',\
|
||||
de.focus_shift.jollyday-core;version='[1.5.0,1.5.1)',\
|
||||
de.focus_shift.jollyday-jackson;version='[1.5.0,1.5.1)'
|
||||
de.focus_shift.jollyday-jackson;version='[1.5.0,1.5.1)',\
|
||||
org.openhab.core.semantics;version='[5.0.0,5.0.1)'
|
||||
|
||||
@@ -82,4 +82,5 @@ Fragment-Host: org.openhab.core.automation
|
||||
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.18.2,2.18.3)',\
|
||||
org.yaml.snakeyaml;version='[2.3.0,2.3.1)',\
|
||||
de.focus_shift.jollyday-core;version='[1.5.0,1.5.1)',\
|
||||
de.focus_shift.jollyday-jackson;version='[1.5.0,1.5.1)'
|
||||
de.focus_shift.jollyday-jackson;version='[1.5.0,1.5.1)',\
|
||||
org.openhab.core.semantics;version='[5.0.0,5.0.1)'
|
||||
|
||||
@@ -82,4 +82,5 @@ Fragment-Host: org.openhab.core.automation
|
||||
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.18.2,2.18.3)',\
|
||||
org.yaml.snakeyaml;version='[2.3.0,2.3.1)',\
|
||||
de.focus_shift.jollyday-core;version='[1.5.0,1.5.1)',\
|
||||
de.focus_shift.jollyday-jackson;version='[1.5.0,1.5.1)'
|
||||
de.focus_shift.jollyday-jackson;version='[1.5.0,1.5.1)',\
|
||||
org.openhab.core.semantics;version='[5.0.0,5.0.1)'
|
||||
|
||||
@@ -74,4 +74,5 @@ Fragment-Host: org.openhab.core.config.discovery.mdns
|
||||
org.openhab.core.transform;version='[5.0.0,5.0.1)',\
|
||||
biz.aQute.tester.junit-platform;version='[7.1.0,7.1.1)',\
|
||||
org.osgi.service.cm;version='[1.6.0,1.6.1)',\
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)'
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)',\
|
||||
org.openhab.core.semantics;version='[5.0.0,5.0.1)'
|
||||
|
||||
@@ -73,4 +73,5 @@ Fragment-Host: org.openhab.core.config.discovery
|
||||
org.openhab.core.transform;version='[5.0.0,5.0.1)',\
|
||||
biz.aQute.tester.junit-platform;version='[7.1.0,7.1.1)',\
|
||||
org.osgi.service.cm;version='[1.6.0,1.6.1)',\
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)'
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)',\
|
||||
org.openhab.core.semantics;version='[5.0.0,5.0.1)'
|
||||
|
||||
@@ -82,4 +82,5 @@ Provide-Capability: \
|
||||
org.openhab.core.transform;version='[5.0.0,5.0.1)',\
|
||||
biz.aQute.tester.junit-platform;version='[7.1.0,7.1.1)',\
|
||||
org.osgi.service.cm;version='[1.6.0,1.6.1)',\
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)'
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)',\
|
||||
org.openhab.core.semantics;version='[5.0.0,5.0.1)'
|
||||
|
||||
@@ -67,4 +67,5 @@ Fragment-Host: org.openhab.core.storage.json
|
||||
org.openhab.core.transform;version='[5.0.0,5.0.1)',\
|
||||
biz.aQute.tester.junit-platform;version='[7.1.0,7.1.1)',\
|
||||
org.osgi.service.cm;version='[1.6.0,1.6.1)',\
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)'
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)',\
|
||||
org.openhab.core.semantics;version='[5.0.0,5.0.1)'
|
||||
|
||||
@@ -74,4 +74,5 @@ Fragment-Host: org.openhab.core.thing
|
||||
org.openhab.core.thing.tests;version='[5.0.0,5.0.1)',\
|
||||
org.openhab.core.transform;version='[5.0.0,5.0.1)',\
|
||||
biz.aQute.tester.junit-platform;version='[7.1.0,7.1.1)',\
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)'
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)',\
|
||||
org.openhab.core.semantics;version='[5.0.0,5.0.1)'
|
||||
|
||||
@@ -80,4 +80,5 @@ Fragment-Host: org.openhab.core.voice
|
||||
org.openhab.core.voice;version='[5.0.0,5.0.1)',\
|
||||
org.openhab.core.voice.tests;version='[5.0.0,5.0.1)',\
|
||||
biz.aQute.tester.junit-platform;version='[7.1.0,7.1.1)',\
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)'
|
||||
org.ops4j.pax.logging.pax-logging-api;version='[2.2.8,2.2.9)',\
|
||||
org.openhab.core.semantics;version='[5.0.0,5.0.1)'
|
||||
|
||||
Reference in New Issue
Block a user