[rest] Add semantic tag registry + API to manage user tags (#3646)

* Add semantic tag registry + REST API to manage user tags

Related to #3619

New registry for semantic tags.
New default semantic tags provider for all built-in semantic tags.
New managed provider to add/remove/update user semantic tags.
Storage of user semantic tags in a JSON DB file.
New REST API to add/remove/update user tags in the semantic model.
New REST API to get a sub-tree of the semantic tags.

Semantic tag class annotations are removed.

Semantic tag classes are now created at runtime.
Classes Locations, Equipments, Points and Properties are removed

Static methods SemanticTags.add removed
The adding of semantic tag classes is now managed only by the tag registry.

Avoids calling static method SemanticTags.getById when possible

SemanticsMetadataProvider service now requires semanticTagRegistry to start.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
pull/3658/head
lolodomo 2023-06-16 16:38:03 +02:00 committed by GitHub
parent 6e83d3f8de
commit f86635fe96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
159 changed files with 1787 additions and 4337 deletions

View File

@ -88,7 +88,7 @@ import org.openhab.core.library.items.SwitchItem;
import org.openhab.core.library.types.OnOffType;
import org.openhab.core.library.types.RawType;
import org.openhab.core.library.types.UpDownType;
import org.openhab.core.semantics.SemanticTags;
import org.openhab.core.semantics.SemanticTagRegistry;
import org.openhab.core.semantics.SemanticsPredicates;
import org.openhab.core.types.Command;
import org.openhab.core.types.State;
@ -182,6 +182,7 @@ public class ItemResource implements RESTResource {
private final ManagedItemProvider managedItemProvider;
private final MetadataRegistry metadataRegistry;
private final MetadataSelectorMatcher metadataSelectorMatcher;
private final SemanticTagRegistry semanticTagRegistry;
private final ItemRegistryChangeListener resetLastModifiedItemChangeListener = new ResetLastModifiedItemChangeListener();
private final RegistryChangeListener<Metadata> resetLastModifiedMetadataChangeListener = new ResetLastModifiedMetadataChangeListener();
@ -196,7 +197,8 @@ public class ItemResource implements RESTResource {
final @Reference LocaleService localeService, //
final @Reference ManagedItemProvider managedItemProvider,
final @Reference MetadataRegistry metadataRegistry,
final @Reference MetadataSelectorMatcher metadataSelectorMatcher) {
final @Reference MetadataSelectorMatcher metadataSelectorMatcher,
final @Reference SemanticTagRegistry semanticTagRegistry) {
this.dtoMapper = dtoMapper;
this.eventPublisher = eventPublisher;
this.itemBuilderFactory = itemBuilderFactory;
@ -205,6 +207,7 @@ public class ItemResource implements RESTResource {
this.managedItemProvider = managedItemProvider;
this.metadataRegistry = metadataRegistry;
this.metadataSelectorMatcher = metadataSelectorMatcher;
this.semanticTagRegistry = semanticTagRegistry;
this.itemRegistry.addRegistryChangeListener(resetLastModifiedItemChangeListener);
this.metadataRegistry.addRegistryChangeListener(resetLastModifiedMetadataChangeListener);
@ -865,7 +868,8 @@ public class ItemResource implements RESTResource {
@PathParam("semanticClass") @Parameter(description = "semantic class") String semanticClassName) {
Locale locale = localeService.getLocale(language);
Class<? extends org.openhab.core.semantics.Tag> semanticClass = SemanticTags.getById(semanticClassName);
Class<? extends org.openhab.core.semantics.Tag> semanticClass = semanticTagRegistry
.getTagClassById(semanticClassName);
if (semanticClass == null) {
return Response.status(Status.NOT_FOUND).build();
}

View File

@ -0,0 +1,41 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.io.rest.core.internal.tag;
import java.util.List;
import org.openhab.core.semantics.SemanticTag;
/**
* A DTO representing a {@link SemanticTag}.
*
* @author Jimmy Tanagra - initial contribution
* @author Laurent Garnier - Class renamed and members uid, description and editable added
*/
public class EnrichedSemanticTagDTO {
String uid;
String name;
String label;
String description;
List<String> synonyms;
boolean editable;
public EnrichedSemanticTagDTO(SemanticTag tag, boolean editable) {
this.uid = tag.getUID();
this.name = tag.getUID().substring(tag.getUID().lastIndexOf("_") + 1);
this.label = tag.getLabel();
this.description = tag.getDescription();
this.synonyms = tag.getSynonyms();
this.editable = editable;
}
}

View File

@ -1,38 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.io.rest.core.internal.tag;
import java.util.List;
import java.util.Locale;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.SemanticTags;
import org.openhab.core.semantics.Tag;
/**
* A DTO representing a Semantic {@link Tag}.
*
* @author Jimmy Tanagra - initial contribution
*/
@NonNullByDefault
public class TagDTO {
String name;
String label;
List<String> synonyms;
public TagDTO(Class<? extends Tag> tag, Locale locale) {
this.name = tag.getSimpleName();
this.label = SemanticTags.getLabel(tag, locale);
this.synonyms = SemanticTags.getSynonyms(tag, locale);
}
}

View File

@ -12,14 +12,19 @@
*/
package org.openhab.core.io.rest.core.internal.tag;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.annotation.security.RolesAllowed;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
@ -35,10 +40,10 @@ import org.openhab.core.io.rest.JSONResponse;
import org.openhab.core.io.rest.LocaleService;
import org.openhab.core.io.rest.RESTConstants;
import org.openhab.core.io.rest.RESTResource;
import org.openhab.core.semantics.model.equipment.Equipments;
import org.openhab.core.semantics.model.location.Locations;
import org.openhab.core.semantics.model.point.Points;
import org.openhab.core.semantics.model.property.Properties;
import org.openhab.core.semantics.ManagedSemanticTagProvider;
import org.openhab.core.semantics.SemanticTag;
import org.openhab.core.semantics.SemanticTagImpl;
import org.openhab.core.semantics.SemanticTagRegistry;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
@ -54,11 +59,13 @@ import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
/**
* This class acts as a REST resource for retrieving a list of tags.
*
* @author Jimmy Tanagra - Initial contribution
* @author Laurent Garnier - Extend REST API to allow adding/updating/removing user tags
*/
@Component
@JaxrsResource
@ -74,28 +81,166 @@ public class TagResource implements RESTResource {
public static final String PATH_TAGS = "tags";
private final LocaleService localeService;
private final SemanticTagRegistry semanticTagRegistry;
private final ManagedSemanticTagProvider managedSemanticTagProvider;
// TODO pattern in @Path
@Activate
public TagResource(final @Reference LocaleService localeService) {
public TagResource(final @Reference LocaleService localeService,
final @Reference SemanticTagRegistry semanticTagRegistry,
final @Reference ManagedSemanticTagProvider managedSemanticTagProvider) {
this.localeService = localeService;
this.semanticTagRegistry = semanticTagRegistry;
this.managedSemanticTagProvider = managedSemanticTagProvider;
}
@GET
@RolesAllowed({ Role.USER, Role.ADMIN })
@Produces(MediaType.APPLICATION_JSON)
@Operation(operationId = "getTags", summary = "Get all available tags.", responses = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TagDTO.class)))) })
@Operation(operationId = "getSemanticTags", summary = "Get all available semantic tags.", responses = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = EnrichedSemanticTagDTO.class)))) })
public Response getTags(final @Context UriInfo uriInfo, final @Context HttpHeaders httpHeaders,
@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language) {
final Locale locale = localeService.getLocale(language);
Map<String, List<TagDTO>> tags = Map.of( //
Locations.class.getSimpleName(), Locations.stream().map(tag -> new TagDTO(tag, locale)).toList(), //
Equipments.class.getSimpleName(), Equipments.stream().map(tag -> new TagDTO(tag, locale)).toList(), //
Points.class.getSimpleName(), Points.stream().map(tag -> new TagDTO(tag, locale)).toList(), //
Properties.class.getSimpleName(), Properties.stream().map(tag -> new TagDTO(tag, locale)).toList() //
);
List<EnrichedSemanticTagDTO> tagsDTO = semanticTagRegistry.getAll().stream()
.sorted(Comparator.comparing(SemanticTag::getUID))
.map(t -> new EnrichedSemanticTagDTO(t.localized(locale), semanticTagRegistry.isEditable(t))).toList();
return JSONResponse.createResponse(Status.OK, tagsDTO, null);
}
return JSONResponse.createResponse(Status.OK, tags, null);
@GET
@RolesAllowed({ Role.USER, Role.ADMIN })
@Path("/{tagId}")
@Produces(MediaType.APPLICATION_JSON)
@Operation(operationId = "getSemanticTagAndSubTags", summary = "Gets a semantic tag and its sub tags.", responses = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = EnrichedSemanticTagDTO.class)))),
@ApiResponse(responseCode = "404", description = "Semantic tag not found.") })
public Response getTagAndSubTags(
@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
@PathParam("tagId") @Parameter(description = "tag id") String tagId) {
final Locale locale = localeService.getLocale(language);
String uid = tagId.trim();
SemanticTag tag = semanticTagRegistry.get(uid);
if (tag != null) {
List<EnrichedSemanticTagDTO> tagsDTO = semanticTagRegistry.getSubTree(tag).stream()
.sorted(Comparator.comparing(SemanticTag::getUID))
.map(t -> new EnrichedSemanticTagDTO(t.localized(locale), semanticTagRegistry.isEditable(t)))
.toList();
return JSONResponse.createResponse(Status.OK, tagsDTO, null);
} else {
return JSONResponse.createErrorResponse(Status.NOT_FOUND, "Tag " + uid + " does not exist!");
}
}
@POST
@RolesAllowed({ Role.ADMIN })
@Consumes(MediaType.APPLICATION_JSON)
@Operation(operationId = "createSemanticTag", summary = "Creates a new semantic tag and adds it to the registry.", security = {
@SecurityRequirement(name = "oauth2", scopes = { "admin" }) }, responses = {
@ApiResponse(responseCode = "201", description = "Created", content = @Content(schema = @Schema(implementation = EnrichedSemanticTagDTO.class))),
@ApiResponse(responseCode = "400", description = "The tag identifier is invalid."),
@ApiResponse(responseCode = "409", description = "A tag with the same identifier already exists.") })
public Response create(
@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
@Parameter(description = "tag data", required = true) EnrichedSemanticTagDTO data) {
final Locale locale = localeService.getLocale(language);
if (data.uid == null) {
return JSONResponse.createErrorResponse(Status.BAD_REQUEST, "Tag identifier is required!");
}
String uid = data.uid.trim();
// check if a tag with this UID already exists
SemanticTag tag = semanticTagRegistry.get(uid);
if (tag != null) {
// report a conflict
return JSONResponse.createResponse(Status.CONFLICT,
new EnrichedSemanticTagDTO(tag.localized(locale), semanticTagRegistry.isEditable(tag)),
"Tag " + uid + " already exists!");
}
tag = new SemanticTagImpl(uid, data.label, data.description, data.synonyms);
// Check that a tag with this uid can be added to the registry
if (!semanticTagRegistry.canBeAdded(tag)) {
return JSONResponse.createErrorResponse(Status.BAD_REQUEST, "Invalid tag identifier " + uid);
}
managedSemanticTagProvider.add(tag);
return JSONResponse.createResponse(Status.CREATED,
new EnrichedSemanticTagDTO(tag.localized(locale), semanticTagRegistry.isEditable(tag)), null);
}
@DELETE
@RolesAllowed({ Role.ADMIN })
@Path("/{tagId}")
@Operation(operationId = "removeSemanticTag", summary = "Removes a semantic tag and its sub tags from the registry.", security = {
@SecurityRequirement(name = "oauth2", scopes = { "admin" }) }, responses = {
@ApiResponse(responseCode = "200", description = "OK, was deleted."),
@ApiResponse(responseCode = "404", description = "Semantic tag not found."),
@ApiResponse(responseCode = "405", description = "Semantic tag not removable.") })
public Response remove(
@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
@PathParam("tagId") @Parameter(description = "tag id") String tagId) {
final Locale locale = localeService.getLocale(language);
String uid = tagId.trim();
// check whether tag exists and throw 404 if not
SemanticTag tag = semanticTagRegistry.get(uid);
if (tag == null) {
return JSONResponse.createErrorResponse(Status.NOT_FOUND, "Tag " + uid + " does not exist!");
}
// Check that tag is removable, 405 otherwise
if (!semanticTagRegistry.isEditable(tag)) {
return JSONResponse.createErrorResponse(Status.METHOD_NOT_ALLOWED, "Tag " + uid + " is not removable.");
}
semanticTagRegistry.removeSubTree(tag);
return Response.ok(null, MediaType.TEXT_PLAIN).build();
}
@PUT
@RolesAllowed({ Role.ADMIN })
@Path("/{tagId}")
@Consumes(MediaType.APPLICATION_JSON)
@Operation(operationId = "updateSemanticTag", summary = "Updates a semantic tag.", security = {
@SecurityRequirement(name = "oauth2", scopes = { "admin" }) }, responses = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = EnrichedSemanticTagDTO.class))),
@ApiResponse(responseCode = "404", description = "Semantic tag not found."),
@ApiResponse(responseCode = "405", description = "Semantic tag not editable.") })
public Response update(
@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
@PathParam("tagId") @Parameter(description = "tag id") String tagId,
@Parameter(description = "tag data", required = true) EnrichedSemanticTagDTO data) {
final Locale locale = localeService.getLocale(language);
String uid = tagId.trim();
// check whether tag exists and throw 404 if not
SemanticTag tag = semanticTagRegistry.get(uid);
if (tag == null) {
return JSONResponse.createErrorResponse(Status.NOT_FOUND, "Tag " + uid + " does not exist!");
}
// Check that tag is editable, 405 otherwise
if (!semanticTagRegistry.isEditable(tag)) {
return JSONResponse.createErrorResponse(Status.METHOD_NOT_ALLOWED, "Tag " + uid + " is not editable.");
}
tag = new SemanticTagImpl(uid, data.label != null ? data.label : tag.getLabel(),
data.description != null ? data.description : tag.getDescription(),
data.synonyms != null ? data.synonyms : tag.getSynonyms());
managedSemanticTagProvider.update(tag);
return JSONResponse.createResponse(Status.OK,
new EnrichedSemanticTagDTO(tag.localized(locale), semanticTagRegistry.isEditable(tag)), null);
}
}

View File

@ -12,12 +12,13 @@
*/
package org.openhab.core.model.script.actions;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.when;
import java.util.List;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@ -33,10 +34,10 @@ import org.openhab.core.items.ItemNotFoundException;
import org.openhab.core.items.ItemRegistry;
import org.openhab.core.library.CoreItemFactory;
import org.openhab.core.model.script.internal.engine.action.SemanticsActionService;
import org.openhab.core.semantics.model.equipment.Battery;
import org.openhab.core.semantics.model.equipment.CleaningRobot;
import org.openhab.core.semantics.model.location.Bathroom;
import org.openhab.core.semantics.model.location.Indoor;
import org.openhab.core.semantics.ManagedSemanticTagProvider;
import org.openhab.core.semantics.Tag;
import org.openhab.core.semantics.internal.SemanticTagRegistryImpl;
import org.openhab.core.semantics.model.DefaultSemanticTagProvider;
/**
* This are tests for {@link Semantics} actions.
@ -50,6 +51,7 @@ public class SemanticsTest {
private @Mock @NonNullByDefault({}) ItemRegistry itemRegistryMock;
private @Mock @NonNullByDefault({}) UnitProvider unitProviderMock;
private @Mock @NonNullByDefault({}) ManagedSemanticTagProvider managedSemanticTagProviderMock;
private @NonNullByDefault({}) GroupItem indoorLocationItem;
private @NonNullByDefault({}) GroupItem bathroomLocationItem;
@ -58,6 +60,11 @@ public class SemanticsTest {
private @NonNullByDefault({}) GenericItem humidityPointItem;
private @NonNullByDefault({}) GenericItem subEquipmentItem;
private @NonNullByDefault({}) Class<? extends Tag> indoorTagClass;
private @NonNullByDefault({}) Class<? extends Tag> bathroomTagClass;
private @NonNullByDefault({}) Class<? extends Tag> cleaningRobotTagClass;
private @NonNullByDefault({}) Class<? extends Tag> batteryTagClass;
@BeforeEach
public void setup() throws ItemNotFoundException {
CoreItemFactory itemFactory = new CoreItemFactory(unitProviderMock);
@ -98,6 +105,15 @@ public class SemanticsTest {
equipmentItem.addMember(subEquipmentItem);
subEquipmentItem.addGroupName(equipmentItem.getName());
when(managedSemanticTagProviderMock.getAll()).thenReturn(List.of());
SemanticTagRegistryImpl semanticTagRegistryImpl = new SemanticTagRegistryImpl(new DefaultSemanticTagProvider(),
managedSemanticTagProviderMock);
indoorTagClass = semanticTagRegistryImpl.getTagClassById("Location_Indoor");
bathroomTagClass = semanticTagRegistryImpl.getTagClassById("Location_Indoor_Room_Bathroom");
cleaningRobotTagClass = semanticTagRegistryImpl.getTagClassById("Equipment_CleaningRobot");
batteryTagClass = semanticTagRegistryImpl.getTagClassById("Equipment_Battery");
when(itemRegistryMock.getItem("TestHouse")).thenReturn(indoorLocationItem);
when(itemRegistryMock.getItem("TestBathRoom")).thenReturn(bathroomLocationItem);
when(itemRegistryMock.getItem("Test08")).thenReturn(equipmentItem);
@ -122,9 +138,9 @@ public class SemanticsTest {
@Test
public void testGetLocationType() {
assertThat(Semantics.getLocationType(indoorLocationItem), is(Indoor.class));
assertThat(Semantics.getLocationType(indoorLocationItem), is(indoorTagClass));
assertThat(Semantics.getLocationType(bathroomLocationItem), is(Bathroom.class));
assertThat(Semantics.getLocationType(bathroomLocationItem), is(bathroomTagClass));
assertNull(Semantics.getLocationType(humidityPointItem));
}
@ -142,11 +158,11 @@ public class SemanticsTest {
@Test
public void testGetEquipmentType() {
assertThat(Semantics.getEquipmentType(equipmentItem), is(CleaningRobot.class));
assertThat(Semantics.getEquipmentType(equipmentItem), is(cleaningRobotTagClass));
assertThat(Semantics.getEquipmentType(temperaturePointItem), is(CleaningRobot.class));
assertThat(Semantics.getEquipmentType(temperaturePointItem), is(cleaningRobotTagClass));
assertThat(Semantics.getEquipmentType(subEquipmentItem), is(Battery.class));
assertThat(Semantics.getEquipmentType(subEquipmentItem), is(batteryTagClass));
assertNull(Semantics.getEquipmentType(humidityPointItem));
}

View File

@ -22,10 +22,6 @@ baseDir = Paths.get(getClass().protectionDomain.codeSource.location.toURI()).get
header = header()
def tagSets = new TreeMap<String, String>()
def locations = new TreeSet<String>()
def equipments = new TreeSet<String>()
def points = new TreeSet<String>()
def properties = new TreeSet<String>()
def labelsFile = new FileWriter("${baseDir}/src/main/resources/tags.properties")
labelsFile.write("# Generated content - do not edit!\n")
@ -36,63 +32,26 @@ for (line in parseCsv(new FileReader("${baseDir}/model/SemanticTags.csv"), separ
def tagSet = (line.Parent ? tagSets.get(line.Parent) : line.Type) + "_" + line.Tag
tagSets.put(line.Tag,tagSet)
createTagSetClass(line, tagSet)
appendLabelsFile(labelsFile, line, tagSet)
switch(line.Type) {
case "Location" : locations.add(line.Tag); break;
case "Equipment" : equipments.add(line.Tag); break;
case "Point" : points.add(line.Tag); break;
case "Property" : properties.add(line.Tag); break;
case "Location" : break;
case "Equipment" : break;
case "Point" : break;
case "Property" : break;
default : println "Unrecognized type " + line.Type
}
}
labelsFile.close()
createLocationsFile(locations)
createEquipmentsFile(equipments)
createPointsFile(points)
createPropertiesFile(properties)
createDefaultProviderFile(tagSets)
println "\n\nTagSets:"
for (String tagSet : tagSets) {
println tagSet
}
def createTagSetClass(def line, String tagSet) {
def tag = line.Tag
def type = line.Type
def label = line.Label
def synonyms = line.Synonyms
def desc = line.Description
def parent = line.Parent
def parentClass = parent ? parent : type
def pkg = type.toLowerCase()
def ch = label.toLowerCase().charAt(0)
def article = ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ? "an" : "a"
def file = new FileWriter("${baseDir}/src/main/java/org/openhab/core/semantics/model/${pkg}/${tag}.java")
file.write(header)
file.write("package org.openhab.core.semantics.model." + pkg + ";\n\n")
file.write("import org.eclipse.jdt.annotation.NonNullByDefault;\n")
if (!parent) {
file.write("import org.openhab.core.semantics." + type + ";\n")
}
file.write("""import org.openhab.core.semantics.TagInfo;
/**
* This class defines ${article} ${label}.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "${tagSet}", label = "${label}", synonyms = "${synonyms}", description = "${desc}")
public interface ${tag} extends ${parentClass} {
}
""")
file.close()
}
def appendLabelsFile(FileWriter file, def line, String tagSet) {
file.write(tagSet + "=" + line.Label)
if (line.Synonyms) {
@ -101,168 +60,59 @@ def appendLabelsFile(FileWriter file, def line, String tagSet) {
file.write("\n")
}
def createLocationsFile(Set<String> locations) {
def file = new FileWriter("${baseDir}/src/main/java/org/openhab/core/semantics/model/location/Locations.java")
def createDefaultProviderFile(def tagSets) {
def file = new FileWriter("${baseDir}/src/main/java/org/openhab/core/semantics/model/DefaultSemanticTagProvider.java")
file.write(header)
file.write("""package org.openhab.core.semantics.model.location;
file.write("""package org.openhab.core.semantics.model;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Stream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Location;
import org.openhab.core.common.registry.ProviderChangeListener;
import org.openhab.core.semantics.SemanticTag;
import org.openhab.core.semantics.SemanticTagImpl;
import org.openhab.core.semantics.SemanticTagProvider;
import org.osgi.service.component.annotations.Component;
/**
* This class provides a stream of all defined locations.
* This class defines a provider of all default semantic tags.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
public class Locations {
@Component(immediate = true, service = { SemanticTagProvider.class, DefaultSemanticTagProvider.class })
public class DefaultSemanticTagProvider implements SemanticTagProvider {
static final Set<Class<? extends Location>> LOCATIONS = new HashSet<>();
private List<SemanticTag> defaultTags;
static {
LOCATIONS.add(Location.class);
public DefaultSemanticTagProvider() {
this.defaultTags = new ArrayList<>();
defaultTags.add(new SemanticTagImpl("Equipment", "", "", ""));
defaultTags.add(new SemanticTagImpl("Location", "", "", ""));
defaultTags.add(new SemanticTagImpl("Point", "", "", ""));
defaultTags.add(new SemanticTagImpl("Property", "", "", ""));
""")
for (String location : locations) {
file.write(" LOCATIONS.add(${location}.class);\n")
}
file.write(""" }
public static Stream<Class<? extends Location>> stream() {
return LOCATIONS.stream();
}
public static boolean add(Class<? extends Location> tag) {
return LOCATIONS.add(tag);
}
}
for (line in parseCsv(new FileReader("${baseDir}/model/SemanticTags.csv"), separator: ',')) {
def tagId = (line.Parent ? tagSets.get(line.Parent) : line.Type) + "_" + line.Tag
file.write(""" defaultTags.add(new SemanticTagImpl("${tagId}", //
"${line.Label}", "${line.Description}", "${line.Synonyms}"));
""")
file.close()
}
def createEquipmentsFile(Set<String> equipments) {
def file = new FileWriter("${baseDir}/src/main/java/org/openhab/core/semantics/model/equipment/Equipments.java")
file.write(header)
file.write("""package org.openhab.core.semantics.model.equipment;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Stream;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
/**
* This class provides a stream of all defined equipments.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
public class Equipments {
static final Set<Class<? extends Equipment>> EQUIPMENTS = new HashSet<>();
static {
EQUIPMENTS.add(Equipment.class);
""")
for (String equipment : equipments) {
file.write(" EQUIPMENTS.add(${equipment}.class);\n")
}
file.write(""" }
public static Stream<Class<? extends Equipment>> stream() {
return EQUIPMENTS.stream();
@Override
public Collection<SemanticTag> getAll() {
return defaultTags;
}
public static boolean add(Class<? extends Equipment> tag) {
return EQUIPMENTS.add(tag);
}
}
""")
file.close()
}
def createPointsFile(Set<String> points) {
def file = new FileWriter("${baseDir}/src/main/java/org/openhab/core/semantics/model/point/Points.java")
file.write(header)
file.write("""package org.openhab.core.semantics.model.point;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Stream;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Point;
/**
* This class provides a stream of all defined points.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
public class Points {
static final Set<Class<? extends Point>> POINTS = new HashSet<>();
static {
POINTS.add(Point.class);
""")
for (String point : points) {
file.write(" POINTS.add(${point}.class);\n")
}
file.write(""" }
public static Stream<Class<? extends Point>> stream() {
return POINTS.stream();
@Override
public void addProviderChangeListener(ProviderChangeListener<SemanticTag> listener) {
}
public static boolean add(Class<? extends Point> tag) {
return POINTS.add(tag);
}
}
""")
file.close()
}
def createPropertiesFile(Set<String> properties) {
def file = new FileWriter("${baseDir}/src/main/java/org/openhab/core/semantics/model/property/Properties.java")
file.write(header)
file.write("""package org.openhab.core.semantics.model.property;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Stream;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Property;
/**
* This class provides a stream of all defined properties.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
public class Properties {
static final Set<Class<? extends Property>> PROPERTIES = new HashSet<>();
static {
PROPERTIES.add(Property.class);
""")
for (String property : properties) {
file.write(" PROPERTIES.add(${property}.class);\n")
}
file.write(""" }
public static Stream<Class<? extends Property>> stream() {
return PROPERTIES.stream();
}
public static boolean add(Class<? extends Property> tag) {
return PROPERTIES.add(tag);
@Override
public void removeProviderChangeListener(ProviderChangeListener<SemanticTag> listener) {
}
}
""")

View File

@ -22,7 +22,6 @@ import org.eclipse.jdt.annotation.Nullable;
* @author Kai Kreuzer - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment")
public interface Equipment extends Tag {
@Nullable

View File

@ -22,7 +22,6 @@ import org.eclipse.jdt.annotation.Nullable;
* @author Kai Kreuzer - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location")
public interface Location extends Tag {
static String name() {

View File

@ -0,0 +1,72 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics;
import java.util.Collection;
import java.util.Comparator;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.core.common.registry.AbstractManagedProvider;
import org.openhab.core.semantics.dto.SemanticTagDTO;
import org.openhab.core.semantics.dto.SemanticTagDTOMapper;
import org.openhab.core.storage.StorageService;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
/**
* {@link ManagedSemanticTagProvider} is an OSGi service, that allows to add or remove
* semantic tags at runtime by calling {@link ManagedSemanticTagProvider#add(SemanticTag)}
* or {@link ManagedSemanticTagProvider#remove(String)}.
* An added semantic tag is automatically exposed to the {@link SemanticTagRegistry}.
* Persistence of added semantic tags is handled by a {@link StorageService}.
*
* @author Laurent Garnier - Initial contribution
*/
@NonNullByDefault
@Component(immediate = true, service = { SemanticTagProvider.class, ManagedSemanticTagProvider.class })
public class ManagedSemanticTagProvider extends AbstractManagedProvider<SemanticTag, String, SemanticTagDTO>
implements SemanticTagProvider {
@Activate
public ManagedSemanticTagProvider(final @Reference StorageService storageService) {
super(storageService);
}
@Override
protected String getStorageName() {
return SemanticTag.class.getName();
}
@Override
protected String keyToString(String key) {
return key;
}
@Override
public Collection<SemanticTag> getAll() {
// Sort tags by uid to be sure that tag classes will be created in the right order
return super.getAll().stream().sorted(Comparator.comparing(SemanticTag::getUID)).toList();
}
@Override
protected @Nullable SemanticTag toElement(String uid, SemanticTagDTO persistedTag) {
return SemanticTagDTOMapper.map(persistedTag);
}
@Override
protected SemanticTagDTO toPersistableElement(SemanticTag tag) {
return SemanticTagDTOMapper.map(tag);
}
}

View File

@ -22,7 +22,6 @@ import org.eclipse.jdt.annotation.Nullable;
* @author Kai Kreuzer - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Point")
public interface Point extends Tag {
@Nullable

View File

@ -20,6 +20,5 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
* @author Kai Kreuzer - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Property")
public interface Property extends Tag {
}

View File

@ -0,0 +1,71 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics;
import java.util.List;
import java.util.Locale;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.common.registry.Identifiable;
/**
* This interface defines the core features of an openHAB semantic tag.
*
* @author Laurent Garnier - Initial contribution
*/
@NonNullByDefault
public interface SemanticTag extends Identifiable<String> {
/**
* Returns the name of the semantic tag.
*
* @return the name of the semantic tag
*/
String getName();
/**
* Returns the UID of the parent tag.
*
* @return the UID of the parent tag
*/
String getParentUID();
/**
* Returns the label of the semantic tag.
*
* @return semantic tag label or an empty string if undefined
*/
String getLabel();
/**
* Returns the description of the semantic tag.
*
* @return semantic tag description or an empty string if undefined
*/
String getDescription();
/**
* Returns the synonyms of the semantic tag.
*
* @return semantic tag synonyms as a List
*/
List<String> getSynonyms();
/**
* Returns the localized semantic tag.
*
* @param locale the locale to be used
* @return the localized semantic tag
*/
SemanticTag localized(Locale locale);
}

View File

@ -0,0 +1,133 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.ResourceBundle.Control;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
/**
* This is the main implementing class of the {@link SemanticTag} interface.
*
* @author Laurent Garnier - Initial contribution
*/
@NonNullByDefault
public class SemanticTagImpl implements SemanticTag {
private static final String TAGS_BUNDLE_NAME = "tags";
private String uid;
private String name;
private String parent;
private String label;
private String description;
private List<String> synonyms;
public SemanticTagImpl(String uid, @Nullable String label, @Nullable String description,
@Nullable List<String> synonyms) {
this(uid, label, description);
if (synonyms != null) {
this.synonyms = new ArrayList<>();
for (String synonym : synonyms) {
this.synonyms.add(synonym.trim());
}
}
}
public SemanticTagImpl(String uid, @Nullable String label, @Nullable String description,
@Nullable String synonyms) {
this(uid, label, description);
if (synonyms != null && !synonyms.isBlank()) {
this.synonyms = new ArrayList<>();
for (String synonym : synonyms.split(",")) {
this.synonyms.add(synonym.trim());
}
}
}
private SemanticTagImpl(String uid, @Nullable String label, @Nullable String description) {
this.uid = uid;
int idx = uid.lastIndexOf("_");
if (idx < 0) {
this.name = uid.trim();
this.parent = "";
} else {
this.name = uid.substring(idx + 1).trim();
this.parent = uid.substring(0, idx).trim();
}
this.label = label == null ? "" : label.trim();
this.description = description == null ? "" : description.trim();
this.synonyms = List.of();
}
@Override
public String getUID() {
return uid;
}
@Override
public String getName() {
return name;
}
@Override
public String getParentUID() {
return parent;
}
@Override
public String getLabel() {
return label;
}
@Override
public String getDescription() {
return description;
}
@Override
public List<String> getSynonyms() {
return synonyms;
}
@Override
public SemanticTag localized(Locale locale) {
ResourceBundle rb = ResourceBundle.getBundle(TAGS_BUNDLE_NAME, locale,
Control.getNoFallbackControl(Control.FORMAT_PROPERTIES));
String label;
List<String> synonyms;
try {
String entry = rb.getString(uid);
int idx = entry.indexOf(",");
if (idx >= 0) {
label = entry.substring(0, idx);
String synonymsCsv = entry.substring(idx + 1);
synonyms = synonymsCsv.isBlank() ? null : List.of(synonymsCsv.split(","));
} else {
label = entry;
synonyms = null;
}
} catch (MissingResourceException e) {
label = getLabel();
synonyms = getSynonyms();
}
return new SemanticTagImpl(uid, label, getDescription(), synonyms);
}
}

View File

@ -10,17 +10,17 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.point;
package org.openhab.core.semantics;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
import org.openhab.core.common.registry.Provider;
/**
* This class defines a Tilt.
* The {@link SemanticTagProvider} is responsible for providing semantic tags.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
* @author Laurent Garnier - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Point_Status_Tilt", label = "Tilt", synonyms = "", description = "")
public interface Tilt extends Status {
public interface SemanticTagProvider extends Provider<SemanticTag> {
}

View File

@ -0,0 +1,80 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics;
import java.util.List;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.core.common.registry.Registry;
/**
* {@link SemanticTagRegistry} tracks all {@link SemanticTag}s from different {@link SemanticTagProvider}s
* and provides access to them.
*
* @author Laurent Garnier - Initial contribution
*/
@NonNullByDefault
public interface SemanticTagRegistry extends Registry<SemanticTag, String> {
/**
* Retrieves the class for a given id.
*
* @param tagId the id of the tag. The id can be fully qualified (e.g. "Location_Room_Bedroom") or a segment, if
* this uniquely identifies the tag
* (e.g. "Bedroom").
* @return the class for the id or null, if non exists.
*/
@Nullable
Class<? extends Tag> getTagClassById(String tagId);
/**
* Checks if a tag with a given id can be added to the registry.
*
* To be added, no tag with this id must already exist in the registry, the tag name extracted from this id
* must have a valid syntax, the parent tag extracted from this id must already exists in the registry and
* should be either a default semantic tag or a managed semantic tag, and no tag with a same name must already
* exist in the registry.
*
* @param tag a tag to be added to the registry
* @return true if the tag can be added, false if not
*/
boolean canBeAdded(SemanticTag tag);
/**
* Returns the provided tag + all tags having the provided tag as ancestor.
*
* @param tag a tag in the registry
* @return a list of all tags having the provided tag as ancestor, including the provided tag itself
*/
List<SemanticTag> getSubTree(SemanticTag tag);
/**
* Indicates if a tag is editable.
*
* To be editable, a tag must be managed.
*
* @param tag a tag in the registry
* @return true if the provided tag is editable, false if not
*/
boolean isEditable(SemanticTag tag);
/**
* Removes the provided tag and all tags having the provided tag as ancestor.
*
* Only removable (managed) tags are removed.
*
* @param tag a tag in the registry
*/
void removeSubTree(SemanticTag tag);
}

View File

@ -12,32 +12,15 @@
*/
package org.openhab.core.semantics;
import java.util.List;
import java.util.Locale;
import java.util.Collections;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.Optional;
import java.util.ResourceBundle;
import java.util.ResourceBundle.Control;
import java.util.Set;
import java.util.TreeMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.openhab.core.items.Item;
import org.openhab.core.semantics.model.equipment.Equipments;
import org.openhab.core.semantics.model.location.Locations;
import org.openhab.core.semantics.model.point.Measurement;
import org.openhab.core.semantics.model.point.Points;
import org.openhab.core.semantics.model.property.Properties;
import org.openhab.core.types.StateDescription;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This is a class that gives static access to the semantic tag library.
@ -45,22 +28,18 @@ import org.slf4j.LoggerFactory;
*
* @author Kai Kreuzer - Initial contribution
* @author Jimmy Tanagra - Add the ability to add new tags at runtime
* @author Laurent Garnier - Several methods moved into class SemanticsService or SemanticTagRegistry
*/
@NonNullByDefault
public class SemanticTags {
private static final String TAGS_BUNDLE_NAME = "tags";
private static final Map<String, Class<? extends Tag>> TAGS = new TreeMap<>();
private static final Logger LOGGER = LoggerFactory.getLogger(SemanticTags.class);
private static final SemanticClassLoader CLASS_LOADER = new SemanticClassLoader();
private static final Map<String, Class<? extends Tag>> TAGS = Collections.synchronizedMap(new TreeMap<>());
static {
Locations.stream().forEach(location -> addTagSet(location));
Equipments.stream().forEach(equipment -> addTagSet(equipment));
Points.stream().forEach(point -> addTagSet(point));
Properties.stream().forEach(property -> addTagSet(property));
addTagSet("Location", Location.class);
addTagSet("Equipment", Equipment.class);
addTagSet("Point", Point.class);
addTagSet("Property", Property.class);
}
/**
@ -75,69 +54,6 @@ public class SemanticTags {
return TAGS.get(tagId);
}
public static @Nullable Class<? extends Tag> getByLabel(String tagLabel, Locale locale) {
Optional<Class<? extends Tag>> tag = TAGS.values().stream().distinct()
.filter(t -> getLabel(t, locale).equalsIgnoreCase(tagLabel)).findFirst();
return tag.isPresent() ? tag.get() : null;
}
public static List<Class<? extends Tag>> getByLabelOrSynonym(String tagLabelOrSynonym, Locale locale) {
return TAGS.values().stream().distinct()
.filter(t -> getLabelAndSynonyms(t, locale).contains(tagLabelOrSynonym.toLowerCase(locale)))
.collect(Collectors.toList());
}
public static List<String> getLabelAndSynonyms(Class<? extends Tag> tag, Locale locale) {
ResourceBundle rb = ResourceBundle.getBundle(TAGS_BUNDLE_NAME, locale,
Control.getNoFallbackControl(Control.FORMAT_PROPERTIES));
TagInfo tagInfo = tag.getAnnotation(TagInfo.class);
try {
String entry = rb.getString(tagInfo.id());
return List.of(entry.toLowerCase(locale).split(","));
} catch (MissingResourceException e) {
Stream<String> label = Stream.of(tagInfo.label());
Stream<String> synonyms = Stream.of(tagInfo.synonyms().split(",")).map(String::trim);
return Stream.concat(label, synonyms).map(s -> s.toLowerCase(locale)).distinct().toList();
}
}
public static String getLabel(Class<? extends Tag> tag, Locale locale) {
ResourceBundle rb = ResourceBundle.getBundle(TAGS_BUNDLE_NAME, locale,
Control.getNoFallbackControl(Control.FORMAT_PROPERTIES));
TagInfo tagInfo = tag.getAnnotation(TagInfo.class);
try {
String entry = rb.getString(tagInfo.id());
if (entry.contains(",")) {
return entry.substring(0, entry.indexOf(","));
} else {
return entry;
}
} catch (MissingResourceException e) {
return tagInfo.label();
}
}
public static List<String> getSynonyms(Class<? extends Tag> tag, Locale locale) {
ResourceBundle rb = ResourceBundle.getBundle(TAGS_BUNDLE_NAME, locale,
Control.getNoFallbackControl(Control.FORMAT_PROPERTIES));
String synonyms = "";
TagInfo tagInfo = tag.getAnnotation(TagInfo.class);
try {
String entry = rb.getString(tagInfo.id());
int start = entry.indexOf(",") + 1;
if (start > 0 && entry.length() > start) {
synonyms = entry.substring(start);
}
} catch (MissingResourceException e) {
synonyms = tagInfo.synonyms();
}
return Stream.of(synonyms.split(",")).map(String::trim).toList();
}
public static String getDescription(Class<? extends Tag> tag, Locale locale) {
return tag.getAnnotation(TagInfo.class).description();
}
/**
* Determines the semantic type of an {@link Item} i.e. a sub-type of {@link Location}, {@link Equipment} or
* {@link Point}.
@ -156,9 +72,9 @@ public class SemanticTags {
if (getProperty(item) != null) {
StateDescription stateDescription = item.getStateDescription();
if (stateDescription != null && stateDescription.isReadOnly()) {
return Measurement.class;
return getById("Point_Measurement");
} else {
return org.openhab.core.semantics.model.point.Control.class;
return getById("Point_Control");
}
} else {
return null;
@ -234,147 +150,11 @@ public class SemanticTags {
return null;
}
/**
* Adds a new semantic tag with inferred label, empty synonyms and description.
*
* The label will be inferred from the tag name by splitting the CamelCase with a space.
*
* @param name the tag name to add
* @param parent the parent tag that the new tag should belong to
* @return the created semantic tag class, or null if it was already added.
*/
public static @Nullable Class<? extends Tag> add(String name, String parent) {
return add(name, parent, null, null, null);
}
/**
* Adds a new semantic tag.
*
* @param name the tag name to add
* @param parent the parent tag that the new tag should belong to
* @param label an optional label. When null, the label will be inferred from the tag name,
* splitting the CamelCase with a space.
* @param synonyms a comma separated list of synonyms
* @param description the tag description
* @return the created semantic tag class, or null if it was already added.
*/
public static @Nullable Class<? extends Tag> add(String name, String parent, @Nullable String label,
@Nullable String synonyms, @Nullable String description) {
Class<? extends Tag> parentClass = getById(parent);
if (parentClass == null) {
LOGGER.warn("Adding semantic tag '{}' failed because parent tag '{}' is not found.", name, parent);
return null;
}
return add(name, parentClass, label, synonyms, description);
}
/**
* Adds a new semantic tag with inferred label, empty synonyms and description.
*
* The label will be inferred from the tag name by splitting the CamelCase with a space.
*
* @param name the tag name to add
* @param parent the parent tag that the new tag should belong to
* @return the created semantic tag class, or null if it was already added.
*/
public static @Nullable Class<? extends Tag> add(String name, Class<? extends Tag> parent) {
return add(name, parent, null, null, null);
}
/**
* Adds a new semantic tag.
*
* @param name the tag name to add
* @param parent the parent tag that the new tag should belong to
* @param label an optional label. When null, the label will be inferred from the tag name,
* splitting the CamelCase with a space.
* @param synonyms a comma separated list of synonyms
* @param description the tag description
* @return the created semantic tag class, or null if it was already added.
*/
public static @Nullable Class<? extends Tag> add(String name, Class<? extends Tag> parent, @Nullable String label,
@Nullable String synonyms, @Nullable String description) {
if (getById(name) != null) {
return null;
}
if (!name.matches("[A-Z][a-zA-Z0-9]+")) {
throw new IllegalArgumentException(
"The tag name '" + name + "' must start with a capital letter and contain only alphanumerics.");
}
String parentId = parent.getAnnotation(TagInfo.class).id();
String type = parentId.split("_")[0];
String className = "org.openhab.core.semantics.model." + type.toLowerCase() + "." + name;
// Infer label from name, splitting up CamelCaseALL99 -> Camel Case ALL 99
label = Optional.ofNullable(label).orElseGet(() -> name.replaceAll("([A-Z][a-z]+|[A-Z][A-Z]+|[0-9]+)", " $1"))
.trim();
synonyms = Optional.ofNullable(synonyms).orElse("").replaceAll("\\s*,\\s*", ",").trim();
// Create the tag interface
ClassWriter classWriter = new ClassWriter(0);
classWriter.visit(Opcodes.V11, Opcodes.ACC_PUBLIC + Opcodes.ACC_ABSTRACT + Opcodes.ACC_INTERFACE,
className.replace('.', '/'), null, "java/lang/Object",
new String[] { parent.getName().replace('.', '/') });
// Add TagInfo Annotation
classWriter.visitSource("Status.java", null);
AnnotationVisitor annotation = classWriter.visitAnnotation("Lorg/openhab/core/semantics/TagInfo;", true);
annotation.visit("id", parentId + "_" + name);
annotation.visit("label", label);
annotation.visit("synonyms", synonyms);
annotation.visit("description", Optional.ofNullable(description).orElse("").trim());
annotation.visitEnd();
classWriter.visitEnd();
byte[] byteCode = classWriter.toByteArray();
Class newTag = null;
try {
newTag = CLASS_LOADER.defineClass(className, byteCode);
} catch (Exception e) {
LOGGER.warn("Failed creating a new semantic tag '{}': {}", className, e.getMessage());
return null;
}
addToModel(newTag);
addTagSet(newTag);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("'{}' semantic {} tag added.", className, type);
}
return newTag;
}
private static void addTagSet(Class<? extends Tag> tagSet) {
String id = tagSet.getAnnotation(TagInfo.class).id();
while (id.indexOf("_") != -1) {
TAGS.put(id, tagSet);
id = id.substring(id.indexOf("_") + 1);
}
public static void addTagSet(String id, Class<? extends Tag> tagSet) {
TAGS.put(id, tagSet);
}
private static boolean addToModel(Class<? extends Tag> tag) {
if (Location.class.isAssignableFrom(tag)) {
return Locations.add((Class<? extends Location>) tag);
} else if (Equipment.class.isAssignableFrom(tag)) {
return Equipments.add((Class<? extends Equipment>) tag);
} else if (Point.class.isAssignableFrom(tag)) {
return Points.add((Class<? extends Point>) tag);
} else if (Property.class.isAssignableFrom(tag)) {
return Properties.add((Class<? extends Property>) tag);
}
throw new IllegalArgumentException("Unknown type of tag " + tag);
}
private static class SemanticClassLoader extends ClassLoader {
public SemanticClassLoader() {
super(SemanticTags.class.getClassLoader());
}
public Class<?> defineClass(String className, byte[] byteCode) {
// defineClass is protected in the normal ClassLoader
return defineClass(className, byteCode, 0, byteCode.length);
}
public static void removeTagSet(String id, Class<? extends Tag> tagSet) {
TAGS.remove(id, tagSet);
}
}

View File

@ -12,16 +12,19 @@
*/
package org.openhab.core.semantics;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.core.items.Item;
/**
* This interface defines a service, which offers functionality regarding semantic tags.
*
* @author Kai Kreuzer - Initial contribution
* @author Laurent Garnier - Few methods moved from class SemanticTags in order to use the semantic tag registry
*/
@NonNullByDefault
public interface SemanticsService {
@ -45,4 +48,34 @@ public interface SemanticsService {
* @return as set of items that are located in the given location(s)
*/
Set<Item> getItemsInLocation(String labelOrSynonym, Locale locale);
/**
* Retrieves the first semantic tag having label matching the given parameter.
* Case is ignored.
*
* @param tagLabel the searched label
* @param locale the locale to be considered
* @return the tag class of the first matching semantic tag or null if no matching found
*/
@Nullable
Class<? extends Tag> getByLabel(String tagLabel, Locale locale);
/**
* Retrieves all semantic tags having label or a synonym matching the given parameter.
* Case is ignored.
*
* @param tagLabelOrSynonym the searched label or synonym
* @param locale the locale to be considered
* @return the List of tag classes of all matching semantic tags
*/
List<Class<? extends Tag>> getByLabelOrSynonym(String tagLabelOrSynonym, Locale locale);
/**
* Gets the label and all synonyms of a semantic tag using the given locale.
*
* @param tagClass the tag class
* @param locale the locale to be considered
* @return the list containing the label and all synonyms of a semantic tag
*/
List<String> getLabelAndSynonyms(Class<? extends Tag> tagClass, Locale locale);
}

View File

@ -1,37 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* This is an annotation to be used on semantic tag classes for providing their ids, labels and descriptions.
*
* @author Kai Kreuzer - Initial contribution
*/
@Retention(RUNTIME)
@Target(TYPE)
public @interface TagInfo {
String id();
String label() default "";
String synonyms() default "";
String description() default "";
}

View File

@ -0,0 +1,31 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.dto;
import java.util.List;
/**
* This is a data transfer object that is used to serialize semantic tags.
*
* @author Laurent Garnier - Initial contribution
*/
public class SemanticTagDTO {
public String uid;
public String label;
public String description;
public List<String> synonyms;
public SemanticTagDTO() {
}
}

View File

@ -0,0 +1,60 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.dto;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.core.semantics.SemanticTag;
import org.openhab.core.semantics.SemanticTagImpl;
/**
* The {@link SemanticTagDTOMapper} is an utility class to map semantic tags into
* semantic tag data transfer objects (DTOs).
*
* @author Laurent Garnier - Initial contribution
*/
@NonNullByDefault
public class SemanticTagDTOMapper {
/**
* Maps semantic tag DTO into semantic tag object.
*
* @param tagDTO the DTO
* @return the semantic tag object
*/
public static @Nullable SemanticTag map(@Nullable SemanticTagDTO tagDTO) {
if (tagDTO == null) {
throw new IllegalArgumentException("The argument 'tagDTO' must not be null.");
}
if (tagDTO.uid == null) {
throw new IllegalArgumentException("The argument 'tagDTO.uid' must not be null.");
}
return new SemanticTagImpl(tagDTO.uid, tagDTO.label, tagDTO.description, tagDTO.synonyms);
}
/**
* Maps semantic tag object into semantic tag DTO.
*
* @param tag the semantic tag
* @return the semantic tag DTO
*/
public static SemanticTagDTO map(SemanticTag tag) {
SemanticTagDTO tagDTO = new SemanticTagDTO();
tagDTO.uid = tag.getUID();
tagDTO.label = tag.getLabel();
tagDTO.description = tag.getDescription();
tagDTO.synonyms = tag.getSynonyms();
return tagDTO;
}
}

View File

@ -0,0 +1,285 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.internal;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.openhab.core.common.registry.AbstractRegistry;
import org.openhab.core.common.registry.Provider;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.Location;
import org.openhab.core.semantics.ManagedSemanticTagProvider;
import org.openhab.core.semantics.Point;
import org.openhab.core.semantics.Property;
import org.openhab.core.semantics.SemanticTag;
import org.openhab.core.semantics.SemanticTagProvider;
import org.openhab.core.semantics.SemanticTagRegistry;
import org.openhab.core.semantics.SemanticTags;
import org.openhab.core.semantics.Tag;
import org.openhab.core.semantics.model.DefaultSemanticTagProvider;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This is the main implementing class of the {@link SemanticTagRegistry} interface. It
* keeps track of all declared semantic tags of all semantic tags providers and keeps
* their current state in memory.
*
* @author Laurent Garnier - Initial contribution
*/
@NonNullByDefault
@Component(immediate = true)
public class SemanticTagRegistryImpl extends AbstractRegistry<SemanticTag, String, SemanticTagProvider>
implements SemanticTagRegistry {
private static final SemanticClassLoader CLASS_LOADER = new SemanticClassLoader();
private final Logger logger = LoggerFactory.getLogger(SemanticTagRegistryImpl.class);
private final DefaultSemanticTagProvider defaultSemanticTagProvider;
private final ManagedSemanticTagProvider managedProvider;
@Activate
public SemanticTagRegistryImpl(@Reference DefaultSemanticTagProvider defaultSemanticTagProvider,
@Reference ManagedSemanticTagProvider managedProvider) {
super(SemanticTagProvider.class);
this.defaultSemanticTagProvider = defaultSemanticTagProvider;
this.managedProvider = managedProvider;
// Add the default semantic tags provider first, before all others
super.addProvider(defaultSemanticTagProvider);
super.addProvider(managedProvider);
setManagedProvider(managedProvider);
}
@Override
protected void addProvider(Provider<SemanticTag> provider) {
// Ignore the default semantic tags provider and the managed provider (they are added in the constructor)
if (!provider.equals(defaultSemanticTagProvider) && !provider.equals(managedProvider)) {
logger.trace("addProvider {} => calling super.addProvider", provider.getClass().getSimpleName());
super.addProvider(provider);
} else {
logger.trace("addProvider {} => ignoring it", provider.getClass().getSimpleName());
}
}
@Override
public @Nullable Class<? extends Tag> getTagClassById(String tagId) {
return SemanticTags.getById(tagId);
}
/**
* Builds the fully qualified id for a semantic tag class.
*
* @param tag the semantic tag class
* @return the fully qualified id
*/
public static String buildId(Class<? extends Tag> tag) {
return buildId("", tag);
}
private static String buildId(String relativeId, Class<?> tag) {
if (!Location.class.isAssignableFrom(tag) && !Equipment.class.isAssignableFrom(tag)
&& !Point.class.isAssignableFrom(tag) && !Property.class.isAssignableFrom(tag)) {
return relativeId;
}
String id = tag.getSimpleName();
if (!relativeId.isEmpty()) {
id += "_" + relativeId;
}
return buildId(id, tag.getInterfaces()[0]);
}
@Override
public boolean canBeAdded(SemanticTag tag) {
String id = tag.getUID();
// check that a tag with this id does not already exist in the registry
if (get(id) != null) {
return false;
}
// Extract the tag name and the parent tag
int lastSeparator = id.lastIndexOf("_");
if (lastSeparator <= 0) {
return false;
}
String name = id.substring(lastSeparator + 1);
String parentId = id.substring(0, lastSeparator);
SemanticTag parent = get(parentId);
// Check that the tag name has a valid syntax and the parent tag already exists
// and is either a default tag or a managed tag
// Check also that a semantic tag class with the same name does not already exist
return name.matches("[A-Z][a-zA-Z0-9]+") && parent != null
&& (managedProvider.get(parentId) != null || defaultSemanticTagProvider.getAll().contains(parent))
&& getTagClassById(name) == null;
}
@Override
public List<SemanticTag> getSubTree(SemanticTag tag) {
List<String> ids = getAll().stream().map(t -> t.getUID()).filter(uid -> uid.startsWith(tag.getUID() + "_"))
.toList();
List<SemanticTag> tags = new ArrayList<>();
tags.add(tag);
ids.forEach(id -> {
SemanticTag t = get(id);
if (t != null) {
tags.add(t);
}
});
return tags;
}
@Override
public boolean isEditable(SemanticTag tag) {
return managedProvider.get(tag.getUID()) != null;
}
@Override
public void removeSubTree(SemanticTag tag) {
// Get tags id in reverse order
List<String> ids = getSubTree(tag).stream().filter(this::isEditable).map(SemanticTag::getUID)
.sorted(Comparator.reverseOrder()).toList();
ids.forEach(managedProvider::remove);
}
@Override
protected void onAddElement(SemanticTag tag) throws IllegalArgumentException {
logger.trace("onAddElement {}", tag.getUID());
super.onAddElement(tag);
String uid = tag.getUID();
Class<? extends Tag> tagClass = getTagClassById(uid);
if (tagClass != null) {
// Class already exists
return;
}
String type;
String className;
Class<? extends Tag> newTag;
int lastSeparator = uid.lastIndexOf("_");
if (lastSeparator < 0) {
switch (uid) {
case "Equipment":
newTag = Equipment.class;
break;
case "Location":
newTag = Location.class;
break;
case "Point":
newTag = Point.class;
break;
case "Property":
newTag = Property.class;
break;
default:
throw new IllegalArgumentException("Failed to create semantic tag '" + uid
+ "': only Equipment, Location, Point and Property are allowed as root tags.");
}
type = uid;
className = newTag.getClass().getName();
} else {
String name = uid.substring(lastSeparator + 1);
String parentId = uid.substring(0, lastSeparator);
Class<? extends Tag> parentTagClass = getTagClassById(parentId);
if (parentTagClass == null) {
throw new IllegalArgumentException(
"Failed to create semantic tag '" + uid + "': no existing parent tag with id " + parentId);
}
if (!name.matches("[A-Z][a-zA-Z0-9]+")) {
throw new IllegalArgumentException("Failed to create semantic tag '" + uid
+ "': tag name must start with a capital letter and contain only alphanumerics.");
}
tagClass = getTagClassById(name);
if (tagClass != null) {
throw new IllegalArgumentException(
"Failed to create semantic tag '" + uid + "': tag '" + buildId(tagClass) + "' already exists.");
}
type = parentId.split("_")[0];
className = "org.openhab.core.semantics.model." + type.toLowerCase() + "." + name;
try {
newTag = (Class<? extends Tag>) Class.forName(className, false, CLASS_LOADER);
logger.debug("'{}' semantic {} tag already exists.", className, type);
} catch (ClassNotFoundException e) {
// Create the tag interface
ClassWriter classWriter = new ClassWriter(0);
classWriter.visit(Opcodes.V11, Opcodes.ACC_PUBLIC + Opcodes.ACC_ABSTRACT + Opcodes.ACC_INTERFACE,
className.replace('.', '/'), null, "java/lang/Object",
new String[] { parentTagClass.getName().replace('.', '/') });
classWriter.visitSource("Status.java", null);
classWriter.visitEnd();
byte[] byteCode = classWriter.toByteArray();
try {
newTag = (Class<? extends Tag>) CLASS_LOADER.defineClass(className, byteCode);
logger.debug("'{}' semantic {} tag created.", className, type);
} catch (Exception ex) {
logger.warn("Failed to create semantic tag '{}': {}", className, ex.getMessage());
throw new IllegalArgumentException("Failed to create semantic tag '" + className + "'", ex);
}
}
}
addTagSet(uid, newTag);
logger.debug("'{}' semantic {} tag added.", className, type);
}
@Override
protected void onRemoveElement(SemanticTag tag) {
logger.trace("onRemoveElement {}", tag.getUID());
super.onRemoveElement(tag);
removeTagSet(tag.getUID());
}
private void addTagSet(String tagId, Class<? extends Tag> tagSet) {
logger.trace("addTagSet {}", tagId);
String id = tagId;
while (id.indexOf("_") != -1) {
SemanticTags.addTagSet(id, tagSet);
id = id.substring(id.indexOf("_") + 1);
}
SemanticTags.addTagSet(id, tagSet);
}
private void removeTagSet(String tagId) {
logger.trace("removeTagSet {}", tagId);
Class<? extends Tag> tagSet = getTagClassById(tagId);
if (tagSet == null) {
return;
}
String id = tagId;
while (id.indexOf("_") != -1) {
SemanticTags.removeTagSet(id, tagSet);
id = id.substring(id.indexOf("_") + 1);
}
SemanticTags.removeTagSet(id, tagSet);
}
private static class SemanticClassLoader extends ClassLoader {
public SemanticClassLoader() {
super(SemanticTagRegistryImpl.class.getClassLoader());
}
public Class<?> defineClass(String className, byte[] byteCode) {
// defineClass is protected in the normal ClassLoader
return defineClass(className, byteCode, 0, byteCode.length);
}
}
}

View File

@ -33,9 +33,9 @@ import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.Location;
import org.openhab.core.semantics.Point;
import org.openhab.core.semantics.Property;
import org.openhab.core.semantics.SemanticTagRegistry;
import org.openhab.core.semantics.SemanticTags;
import org.openhab.core.semantics.Tag;
import org.openhab.core.semantics.TagInfo;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
@ -75,7 +75,8 @@ public class SemanticsMetadataProvider extends AbstractProvider<Metadata>
private final ItemRegistry itemRegistry;
@Activate
public SemanticsMetadataProvider(final @Reference ItemRegistry itemRegistry) {
public SemanticsMetadataProvider(final @Reference ItemRegistry itemRegistry,
final @Reference SemanticTagRegistry semanticTagRegistry) {
this.itemRegistry = itemRegistry;
}
@ -111,7 +112,7 @@ public class SemanticsMetadataProvider extends AbstractProvider<Metadata>
if (type != null) {
processProperties(item, configuration);
processHierarchy(item, configuration);
Metadata md = new Metadata(key, type.getAnnotation(TagInfo.class).id(), configuration);
Metadata md = new Metadata(key, SemanticTagRegistryImpl.buildId(type), configuration);
Metadata oldMd = semantics.put(item.getName(), md);
if (oldMd == null) {
notifyListenersAboutAddedElement(md);
@ -148,7 +149,7 @@ public class SemanticsMetadataProvider extends AbstractProvider<Metadata>
if (entityClass.isAssignableFrom(type)) {
Class<? extends Property> p = SemanticTags.getProperty(item);
if (p != null) {
configuration.put(relation.getValue(), p.getAnnotation(TagInfo.class).id());
configuration.put(relation.getValue(), SemanticTagRegistryImpl.buildId(p));
}
}
}

View File

@ -12,14 +12,19 @@
*/
package org.openhab.core.semantics.internal;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.core.items.GroupItem;
import org.openhab.core.items.Item;
import org.openhab.core.items.ItemPredicates;
@ -30,7 +35,8 @@ import org.openhab.core.items.MetadataRegistry;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.Location;
import org.openhab.core.semantics.Point;
import org.openhab.core.semantics.SemanticTags;
import org.openhab.core.semantics.SemanticTag;
import org.openhab.core.semantics.SemanticTagRegistry;
import org.openhab.core.semantics.SemanticsPredicates;
import org.openhab.core.semantics.SemanticsService;
import org.openhab.core.semantics.Tag;
@ -42,6 +48,7 @@ import org.osgi.service.component.annotations.Reference;
* The internal implementation of the {@link SemanticsService} interface, which is registered as an OSGi service.
*
* @author Kai Kreuzer - Initial contribution
* @author Laurent Garnier - Few methods moved from class SemanticTags in order to use the semantic tag registry
*/
@NonNullByDefault
@Component
@ -51,12 +58,15 @@ public class SemanticsServiceImpl implements SemanticsService {
private final ItemRegistry itemRegistry;
private final MetadataRegistry metadataRegistry;
private final SemanticTagRegistry semanticTagRegistry;
@Activate
public SemanticsServiceImpl(final @Reference ItemRegistry itemRegistry,
final @Reference MetadataRegistry metadataRegistry) {
final @Reference MetadataRegistry metadataRegistry,
final @Reference SemanticTagRegistry semanticTagRegistry) {
this.itemRegistry = itemRegistry;
this.metadataRegistry = metadataRegistry;
this.semanticTagRegistry = semanticTagRegistry;
}
@Override
@ -77,7 +87,7 @@ public class SemanticsServiceImpl implements SemanticsService {
@Override
public Set<Item> getItemsInLocation(String labelOrSynonym, Locale locale) {
Set<Item> items = new HashSet<>();
List<Class<? extends Tag>> tagList = SemanticTags.getByLabelOrSynonym(labelOrSynonym, locale);
List<Class<? extends Tag>> tagList = getByLabelOrSynonym(labelOrSynonym, locale);
if (!tagList.isEmpty()) {
for (Class<? extends Tag> tag : tagList) {
if (Location.class.isAssignableFrom(tag)) {
@ -112,4 +122,40 @@ public class SemanticsServiceImpl implements SemanticsService {
return false;
};
}
@Override
public @Nullable Class<? extends Tag> getByLabel(String tagLabel, Locale locale) {
Optional<SemanticTag> tag = semanticTagRegistry.getAll().stream()
.filter(t -> t.localized(locale).getLabel().equalsIgnoreCase(tagLabel))
.sorted(Comparator.comparing(SemanticTag::getUID)).findFirst();
return tag.isPresent() ? semanticTagRegistry.getTagClassById(tag.get().getUID()) : null;
}
@Override
public List<Class<? extends Tag>> getByLabelOrSynonym(String tagLabelOrSynonym, Locale locale) {
List<SemanticTag> tags = semanticTagRegistry.getAll().stream()
.filter(t -> getLabelAndSynonyms(t, locale).contains(tagLabelOrSynonym.toLowerCase(locale)))
.sorted(Comparator.comparing(SemanticTag::getUID)).toList();
List<Class<? extends Tag>> tagList = new ArrayList<>();
tags.forEach(t -> {
Class<? extends Tag> tag = semanticTagRegistry.getTagClassById(t.getUID());
if (tag != null) {
tagList.add(tag);
}
});
return tagList;
}
@Override
public List<String> getLabelAndSynonyms(Class<? extends Tag> tagClass, Locale locale) {
SemanticTag tag = semanticTagRegistry.get(SemanticTagRegistryImpl.buildId(tagClass));
return tag == null ? List.of() : getLabelAndSynonyms(tag, locale);
}
private List<String> getLabelAndSynonyms(SemanticTag tag, Locale locale) {
SemanticTag localizedTag = tag.localized(locale);
Stream<String> label = Stream.of(localizedTag.getLabel());
Stream<String> synonyms = localizedTag.getSynonyms().stream();
return Stream.concat(label, synonyms).map(s -> s.toLowerCase(locale)).distinct().toList();
}
}

View File

@ -0,0 +1,311 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.common.registry.ProviderChangeListener;
import org.openhab.core.semantics.SemanticTag;
import org.openhab.core.semantics.SemanticTagImpl;
import org.openhab.core.semantics.SemanticTagProvider;
import org.osgi.service.component.annotations.Component;
/**
* This class defines a provider of all default semantic tags.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@Component(immediate = true, service = { SemanticTagProvider.class, DefaultSemanticTagProvider.class })
public class DefaultSemanticTagProvider implements SemanticTagProvider {
private List<SemanticTag> defaultTags;
public DefaultSemanticTagProvider() {
this.defaultTags = new ArrayList<>();
defaultTags.add(new SemanticTagImpl("Equipment", "", "", ""));
defaultTags.add(new SemanticTagImpl("Location", "", "", ""));
defaultTags.add(new SemanticTagImpl("Point", "", "", ""));
defaultTags.add(new SemanticTagImpl("Property", "", "", ""));
defaultTags.add(new SemanticTagImpl("Location_Indoor", //
"Indoor", "Anything that is inside a closed building", ""));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Apartment", //
"Apartment", "", "Apartments"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Building", //
"Building", "", "Buildings"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Building_Garage", //
"Garage", "", "Garages"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Building_House", //
"House", "", "Houses"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Building_Shed", //
"Shed", "", "Sheds"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Building_SummerHouse", //
"Summer House", "", "Summer Houses, Second Home, Second Homes"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Floor", //
"Floor", "", "Floors"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Floor_GroundFloor", //
"Ground Floor", "", "Ground Floors, Downstairs"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Floor_FirstFloor", //
"First Floor", "", "First Floors, Upstairs"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Floor_SecondFloor", //
"Second Floor", "", "Second Floors"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Floor_ThirdFloor", //
"Third Floor", "", "Third Floors"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Floor_Attic", //
"Attic", "", "Attics"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Floor_Basement", //
"Basement", "", "Basements"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Corridor", //
"Corridor", "", "Corridors, Hallway, Hallways"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room", //
"Room", "", "Rooms"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_Bathroom", //
"Bathroom", "", "Bathrooms, Bath, Baths, Powder Room, Powder Rooms"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_Bedroom", //
"Bedroom", "", "Bedrooms"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_BoilerRoom", //
"Boiler Room", "", "Boiler Rooms"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_Cellar", //
"Cellar", "", "Cellars"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_DiningRoom", //
"Dining Room", "", "Dining Rooms"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_Entry", //
"Entry", "", "Entries, Foyer, Foyers"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_FamilyRoom", //
"Family Room", "", "Family Rooms"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_GuestRoom", //
"Guest Room", "", "Guest Rooms"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_Kitchen", //
"Kitchen", "", "Kitchens"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_LaundryRoom", //
"Laundry Room", "", "Laundry Rooms"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_LivingRoom", //
"Living Room", "", "Living Rooms"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_Office", //
"Office", "", "Offices"));
defaultTags.add(new SemanticTagImpl("Location_Indoor_Room_Veranda", //
"Veranda", "", "Verandas"));
defaultTags.add(new SemanticTagImpl("Location_Outdoor", //
"Outdoor", "", ""));
defaultTags.add(new SemanticTagImpl("Location_Outdoor_Carport", //
"Carport", "", "Carports"));
defaultTags.add(new SemanticTagImpl("Location_Outdoor_Driveway", //
"Driveway", "", "Driveways"));
defaultTags.add(new SemanticTagImpl("Location_Outdoor_Garden", //
"Garden", "", "Gardens"));
defaultTags.add(new SemanticTagImpl("Location_Outdoor_Patio", //
"Patio", "", "Patios"));
defaultTags.add(new SemanticTagImpl("Location_Outdoor_Porch", //
"Porch", "", "Porches"));
defaultTags.add(new SemanticTagImpl("Location_Outdoor_Terrace", //
"Terrace", "", "Terraces, Deck, Decks"));
defaultTags.add(new SemanticTagImpl("Property_Temperature", //
"Temperature", "", "Temperatures"));
defaultTags.add(new SemanticTagImpl("Property_Light", //
"Light", "", "Lights, Lighting"));
defaultTags.add(new SemanticTagImpl("Property_ColorTemperature", //
"Color Temperature", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Humidity", //
"Humidity", "", "Moisture"));
defaultTags.add(new SemanticTagImpl("Property_Presence", //
"Presence", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Pressure", //
"Pressure", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Smoke", //
"Smoke", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Noise", //
"Noise", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Rain", //
"Rain", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Wind", //
"Wind", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Water", //
"Water", "", ""));
defaultTags.add(new SemanticTagImpl("Property_CO2", //
"CO2", "", "Carbon Dioxide"));
defaultTags.add(new SemanticTagImpl("Property_CO", //
"CO", "", "Carbon Monoxide"));
defaultTags.add(new SemanticTagImpl("Property_Energy", //
"Energy", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Power", //
"Power", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Voltage", //
"Voltage", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Current", //
"Current", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Frequency", //
"Frequency", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Gas", //
"Gas", "", ""));
defaultTags.add(new SemanticTagImpl("Property_SoundVolume", //
"Sound Volume", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Oil", //
"Oil", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Duration", //
"Duration", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Level", //
"Level", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Opening", //
"Opening", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Timestamp", //
"Timestamp", "", ""));
defaultTags.add(new SemanticTagImpl("Property_Ultraviolet", //
"Ultraviolet", "", "UV"));
defaultTags.add(new SemanticTagImpl("Property_Vibration", //
"Vibration", "", ""));
defaultTags.add(new SemanticTagImpl("Point_Alarm", //
"Alarm", "", ""));
defaultTags.add(new SemanticTagImpl("Point_Control", //
"Control", "", ""));
defaultTags.add(new SemanticTagImpl("Point_Control_Switch", //
"Switch", "", ""));
defaultTags.add(new SemanticTagImpl("Point_Measurement", //
"Measurement", "", ""));
defaultTags.add(new SemanticTagImpl("Point_Setpoint", //
"Setpoint", "", ""));
defaultTags.add(new SemanticTagImpl("Point_Status", //
"Status", "", ""));
defaultTags.add(new SemanticTagImpl("Point_Status_LowBattery", //
"LowBattery", "", ""));
defaultTags.add(new SemanticTagImpl("Point_Status_OpenLevel", //
"OpenLevel", "", ""));
defaultTags.add(new SemanticTagImpl("Point_Status_OpenState", //
"OpenState", "", ""));
defaultTags.add(new SemanticTagImpl("Point_Status_Tampered", //
"Tampered", "", ""));
defaultTags.add(new SemanticTagImpl("Point_Status_Tilt", //
"Tilt", "", ""));
defaultTags.add(new SemanticTagImpl("Equipment_AlarmSystem", //
"Alarm System", "", "Alarm Systems"));
defaultTags.add(new SemanticTagImpl("Equipment_Battery", //
"Battery", "", "Batteries"));
defaultTags.add(new SemanticTagImpl("Equipment_Blinds", //
"Blinds", "", "Rollershutter, Rollershutters, Roller shutter, Roller shutters, Shutter, Shutters"));
defaultTags.add(new SemanticTagImpl("Equipment_Boiler", //
"Boiler", "", "Boilers"));
defaultTags.add(new SemanticTagImpl("Equipment_Camera", //
"Camera", "", "Cameras"));
defaultTags.add(new SemanticTagImpl("Equipment_Car", //
"Car", "", "Cars"));
defaultTags.add(new SemanticTagImpl("Equipment_CleaningRobot", //
"Cleaning Robot", "", "Cleaning Robots, Vacuum robot, Vacuum robots"));
defaultTags.add(new SemanticTagImpl("Equipment_Door", //
"Door", "", "Doors"));
defaultTags.add(new SemanticTagImpl("Equipment_Door_BackDoor", //
"Back Door", "", "Back Doors"));
defaultTags.add(new SemanticTagImpl("Equipment_Door_CellarDoor", //
"Cellar Door", "", "Cellar Doors"));
defaultTags.add(new SemanticTagImpl("Equipment_Door_FrontDoor", //
"Front Door", "", "Front Doors, Frontdoor, Frontdoors"));
defaultTags.add(new SemanticTagImpl("Equipment_Door_GarageDoor", //
"Garage Door", "", "Garage Doors"));
defaultTags.add(new SemanticTagImpl("Equipment_Door_Gate", //
"Gate", "", "Gates"));
defaultTags.add(new SemanticTagImpl("Equipment_Door_InnerDoor", //
"Inner Door", "", "Inner Doors"));
defaultTags.add(new SemanticTagImpl("Equipment_Door_SideDoor", //
"Side Door", "", "Side Doors"));
defaultTags.add(new SemanticTagImpl("Equipment_Doorbell", //
"Doorbell", "", "Doorbells"));
defaultTags.add(new SemanticTagImpl("Equipment_Fan", //
"Fan", "", "Fans"));
defaultTags.add(new SemanticTagImpl("Equipment_Fan_CeilingFan", //
"Ceiling Fan", "", "Ceiling Fans"));
defaultTags.add(new SemanticTagImpl("Equipment_Fan_KitchenHood", //
"Kitchen Hood", "", "Kitchen Hoods"));
defaultTags.add(new SemanticTagImpl("Equipment_HVAC", //
"HVAC", "", "Heating, Ventilation, Air Conditioning, A/C, A/Cs, AC"));
defaultTags.add(new SemanticTagImpl("Equipment_Inverter", //
"Inverter", "", "Inverters"));
defaultTags.add(new SemanticTagImpl("Equipment_LawnMower", //
"Lawn Mower", "", "Lawn Mowers"));
defaultTags.add(new SemanticTagImpl("Equipment_Lightbulb", //
"Lightbulb", "", "Lightbulbs, Bulb, Bulbs, Lamp, Lamps, Lights, Lighting"));
defaultTags.add(new SemanticTagImpl("Equipment_Lightbulb_LightStripe", //
"Light Stripe", "", "Light Stripes"));
defaultTags.add(new SemanticTagImpl("Equipment_Lock", //
"Lock", "", "Locks"));
defaultTags.add(new SemanticTagImpl("Equipment_NetworkAppliance", //
"Network Appliance", "", "Network Appliances"));
defaultTags.add(new SemanticTagImpl("Equipment_PowerOutlet", //
"Power Outlet", "", "Power Outlets, Outlet, Outlets"));
defaultTags.add(new SemanticTagImpl("Equipment_Projector", //
"Projector", "", "Projectors, Beamer, Beamers"));
defaultTags.add(new SemanticTagImpl("Equipment_Pump", //
"Pump", "", "Pumps"));
defaultTags.add(new SemanticTagImpl("Equipment_RadiatorControl", //
"Radiator Control", "", "Radiator Controls, Radiator, Radiators"));
defaultTags.add(new SemanticTagImpl("Equipment_Receiver", //
"Receiver", "", "Receivers, Audio Receiver, Audio Receivers, AV Receiver, AV Receivers"));
defaultTags.add(new SemanticTagImpl("Equipment_RemoteControl", //
"Remote Control", "", "Remote Controls"));
defaultTags.add(new SemanticTagImpl("Equipment_Screen", //
"Screen", "", "Screens"));
defaultTags.add(new SemanticTagImpl("Equipment_Screen_Television", //
"Television", "", "Televisions, TV, TVs"));
defaultTags.add(new SemanticTagImpl("Equipment_Sensor", //
"Sensor", "", "Sensors"));
defaultTags.add(new SemanticTagImpl("Equipment_Sensor_MotionDetector", //
"Motion Detector", "", "Motion Detectors, Motion sensor, Motion sensors"));
defaultTags.add(new SemanticTagImpl("Equipment_Sensor_SmokeDetector", //
"Smoke Detector", "", "Smoke Detectors"));
defaultTags.add(new SemanticTagImpl("Equipment_Siren", //
"Siren", "", "Sirens"));
defaultTags.add(new SemanticTagImpl("Equipment_Smartphone", //
"Smartphone", "", "Smartphones, Phone, Phones"));
defaultTags.add(new SemanticTagImpl("Equipment_Speaker", //
"Speaker", "", "Speakers"));
defaultTags.add(new SemanticTagImpl("Equipment_Valve", //
"Valve", "", "Valves"));
defaultTags.add(new SemanticTagImpl("Equipment_VoiceAssistant", //
"Voice Assistant", "", "Voice Assistants"));
defaultTags.add(new SemanticTagImpl("Equipment_WallSwitch", //
"Wall Switch", "", "Wall Switches"));
defaultTags.add(new SemanticTagImpl("Equipment_WebService", //
"Web Service", "", "Web Services"));
defaultTags.add(new SemanticTagImpl("Equipment_WebService_WeatherService", //
"Weather Service", "", "Weather Services"));
defaultTags.add(new SemanticTagImpl("Equipment_WhiteGood", //
"White Good", "", "White Goods"));
defaultTags.add(new SemanticTagImpl("Equipment_WhiteGood_Dishwasher", //
"Dishwasher", "", "Dishwashers"));
defaultTags.add(new SemanticTagImpl("Equipment_WhiteGood_Dryer", //
"Dryer", "", "Dryers"));
defaultTags.add(new SemanticTagImpl("Equipment_WhiteGood_Freezer", //
"Freezer", "", "Freezers"));
defaultTags.add(new SemanticTagImpl("Equipment_WhiteGood_Oven", //
"Oven", "", "Ovens"));
defaultTags.add(new SemanticTagImpl("Equipment_WhiteGood_Refrigerator", //
"Refrigerator", "", "Refrigerators"));
defaultTags.add(new SemanticTagImpl("Equipment_WhiteGood_WashingMachine", //
"Washing Machine", "", "Washing Machines"));
defaultTags.add(new SemanticTagImpl("Equipment_Window", //
"Window", "", "Windows"));
}
@Override
public Collection<SemanticTag> getAll() {
return defaultTags;
}
@Override
public void addProviderChangeListener(ProviderChangeListener<SemanticTag> listener) {
}
@Override
public void removeProviderChangeListener(ProviderChangeListener<SemanticTag> listener) {
}
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines an Alarm System.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_AlarmSystem", label = "Alarm System", synonyms = "Alarm Systems", description = "")
public interface AlarmSystem extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Back Door.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Door_BackDoor", label = "Back Door", synonyms = "Back Doors", description = "")
public interface BackDoor extends Door {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Battery.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Battery", label = "Battery", synonyms = "Batteries", description = "")
public interface Battery extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Blinds.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Blinds", label = "Blinds", synonyms = "Rollershutter, Rollershutters, Roller shutter, Roller shutters, Shutter, Shutters", description = "")
public interface Blinds extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Boiler.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Boiler", label = "Boiler", synonyms = "Boilers", description = "")
public interface Boiler extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Camera.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Camera", label = "Camera", synonyms = "Cameras", description = "")
public interface Camera extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Car.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Car", label = "Car", synonyms = "Cars", description = "")
public interface Car extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Ceiling Fan.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Fan_CeilingFan", label = "Ceiling Fan", synonyms = "Ceiling Fans", description = "")
public interface CeilingFan extends Fan {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Cellar Door.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Door_CellarDoor", label = "Cellar Door", synonyms = "Cellar Doors", description = "")
public interface CellarDoor extends Door {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Cleaning Robot.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_CleaningRobot", label = "Cleaning Robot", synonyms = "Cleaning Robots, Vacuum robot, Vacuum robots", description = "")
public interface CleaningRobot extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Dishwasher.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_WhiteGood_Dishwasher", label = "Dishwasher", synonyms = "Dishwashers", description = "")
public interface Dishwasher extends WhiteGood {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Door.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Door", label = "Door", synonyms = "Doors", description = "")
public interface Door extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Doorbell.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Doorbell", label = "Doorbell", synonyms = "Doorbells", description = "")
public interface Doorbell extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Dryer.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_WhiteGood_Dryer", label = "Dryer", synonyms = "Dryers", description = "")
public interface Dryer extends WhiteGood {
}

View File

@ -1,96 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Stream;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
/**
* This class provides a stream of all defined equipments.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
public class Equipments {
static final Set<Class<? extends Equipment>> EQUIPMENTS = new HashSet<>();
static {
EQUIPMENTS.add(Equipment.class);
EQUIPMENTS.add(AlarmSystem.class);
EQUIPMENTS.add(BackDoor.class);
EQUIPMENTS.add(Battery.class);
EQUIPMENTS.add(Blinds.class);
EQUIPMENTS.add(Boiler.class);
EQUIPMENTS.add(Camera.class);
EQUIPMENTS.add(Car.class);
EQUIPMENTS.add(CeilingFan.class);
EQUIPMENTS.add(CellarDoor.class);
EQUIPMENTS.add(CleaningRobot.class);
EQUIPMENTS.add(Dishwasher.class);
EQUIPMENTS.add(Door.class);
EQUIPMENTS.add(Doorbell.class);
EQUIPMENTS.add(Dryer.class);
EQUIPMENTS.add(Fan.class);
EQUIPMENTS.add(Freezer.class);
EQUIPMENTS.add(FrontDoor.class);
EQUIPMENTS.add(GarageDoor.class);
EQUIPMENTS.add(Gate.class);
EQUIPMENTS.add(HVAC.class);
EQUIPMENTS.add(InnerDoor.class);
EQUIPMENTS.add(Inverter.class);
EQUIPMENTS.add(KitchenHood.class);
EQUIPMENTS.add(LawnMower.class);
EQUIPMENTS.add(LightStripe.class);
EQUIPMENTS.add(Lightbulb.class);
EQUIPMENTS.add(Lock.class);
EQUIPMENTS.add(MotionDetector.class);
EQUIPMENTS.add(NetworkAppliance.class);
EQUIPMENTS.add(Oven.class);
EQUIPMENTS.add(PowerOutlet.class);
EQUIPMENTS.add(Projector.class);
EQUIPMENTS.add(Pump.class);
EQUIPMENTS.add(RadiatorControl.class);
EQUIPMENTS.add(Receiver.class);
EQUIPMENTS.add(Refrigerator.class);
EQUIPMENTS.add(RemoteControl.class);
EQUIPMENTS.add(Screen.class);
EQUIPMENTS.add(Sensor.class);
EQUIPMENTS.add(SideDoor.class);
EQUIPMENTS.add(Siren.class);
EQUIPMENTS.add(Smartphone.class);
EQUIPMENTS.add(SmokeDetector.class);
EQUIPMENTS.add(Speaker.class);
EQUIPMENTS.add(Television.class);
EQUIPMENTS.add(Valve.class);
EQUIPMENTS.add(VoiceAssistant.class);
EQUIPMENTS.add(WallSwitch.class);
EQUIPMENTS.add(WashingMachine.class);
EQUIPMENTS.add(WeatherService.class);
EQUIPMENTS.add(WebService.class);
EQUIPMENTS.add(WhiteGood.class);
EQUIPMENTS.add(Window.class);
}
public static Stream<Class<? extends Equipment>> stream() {
return EQUIPMENTS.stream();
}
public static boolean add(Class<? extends Equipment> tag) {
return EQUIPMENTS.add(tag);
}
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Fan.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Fan", label = "Fan", synonyms = "Fans", description = "")
public interface Fan extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Freezer.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_WhiteGood_Freezer", label = "Freezer", synonyms = "Freezers", description = "")
public interface Freezer extends WhiteGood {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Front Door.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Door_FrontDoor", label = "Front Door", synonyms = "Front Doors, Frontdoor, Frontdoors", description = "")
public interface FrontDoor extends Door {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Garage Door.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Door_GarageDoor", label = "Garage Door", synonyms = "Garage Doors", description = "")
public interface GarageDoor extends Door {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Gate.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Door_Gate", label = "Gate", synonyms = "Gates", description = "")
public interface Gate extends Door {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a HVAC.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_HVAC", label = "HVAC", synonyms = "Heating, Ventilation, Air Conditioning, A/C, A/Cs, AC", description = "")
public interface HVAC extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines an Inner Door.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Door_InnerDoor", label = "Inner Door", synonyms = "Inner Doors", description = "")
public interface InnerDoor extends Door {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines an Inverter.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Inverter", label = "Inverter", synonyms = "Inverters", description = "")
public interface Inverter extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Kitchen Hood.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Fan_KitchenHood", label = "Kitchen Hood", synonyms = "Kitchen Hoods", description = "")
public interface KitchenHood extends Fan {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Lawn Mower.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_LawnMower", label = "Lawn Mower", synonyms = "Lawn Mowers", description = "")
public interface LawnMower extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Light Stripe.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Lightbulb_LightStripe", label = "Light Stripe", synonyms = "Light Stripes", description = "")
public interface LightStripe extends Lightbulb {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Lightbulb.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Lightbulb", label = "Lightbulb", synonyms = "Lightbulbs, Bulb, Bulbs, Lamp, Lamps, Lights, Lighting", description = "")
public interface Lightbulb extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Lock.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Lock", label = "Lock", synonyms = "Locks", description = "")
public interface Lock extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Motion Detector.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Sensor_MotionDetector", label = "Motion Detector", synonyms = "Motion Detectors, Motion sensor, Motion sensors", description = "")
public interface MotionDetector extends Sensor {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Network Appliance.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_NetworkAppliance", label = "Network Appliance", synonyms = "Network Appliances", description = "")
public interface NetworkAppliance extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines an Oven.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_WhiteGood_Oven", label = "Oven", synonyms = "Ovens", description = "")
public interface Oven extends WhiteGood {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Power Outlet.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_PowerOutlet", label = "Power Outlet", synonyms = "Power Outlets, Outlet, Outlets", description = "")
public interface PowerOutlet extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Projector.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Projector", label = "Projector", synonyms = "Projectors, Beamer, Beamers", description = "")
public interface Projector extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Pump.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Pump", label = "Pump", synonyms = "Pumps", description = "")
public interface Pump extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Radiator Control.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_RadiatorControl", label = "Radiator Control", synonyms = "Radiator Controls, Radiator, Radiators", description = "")
public interface RadiatorControl extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Receiver.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Receiver", label = "Receiver", synonyms = "Receivers, Audio Receiver, Audio Receivers, AV Receiver, AV Receivers", description = "")
public interface Receiver extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Refrigerator.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_WhiteGood_Refrigerator", label = "Refrigerator", synonyms = "Refrigerators", description = "")
public interface Refrigerator extends WhiteGood {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Remote Control.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_RemoteControl", label = "Remote Control", synonyms = "Remote Controls", description = "")
public interface RemoteControl extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Screen.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Screen", label = "Screen", synonyms = "Screens", description = "")
public interface Screen extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Sensor.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Sensor", label = "Sensor", synonyms = "Sensors", description = "")
public interface Sensor extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Side Door.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Door_SideDoor", label = "Side Door", synonyms = "Side Doors", description = "")
public interface SideDoor extends Door {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Siren.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Siren", label = "Siren", synonyms = "Sirens", description = "")
public interface Siren extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Smartphone.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Smartphone", label = "Smartphone", synonyms = "Smartphones, Phone, Phones", description = "")
public interface Smartphone extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Smoke Detector.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Sensor_SmokeDetector", label = "Smoke Detector", synonyms = "Smoke Detectors", description = "")
public interface SmokeDetector extends Sensor {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Speaker.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Speaker", label = "Speaker", synonyms = "Speakers", description = "")
public interface Speaker extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Television.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Screen_Television", label = "Television", synonyms = "Televisions, TV, TVs", description = "")
public interface Television extends Screen {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Valve.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Valve", label = "Valve", synonyms = "Valves", description = "")
public interface Valve extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Voice Assistant.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_VoiceAssistant", label = "Voice Assistant", synonyms = "Voice Assistants", description = "")
public interface VoiceAssistant extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Wall Switch.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_WallSwitch", label = "Wall Switch", synonyms = "Wall Switches", description = "")
public interface WallSwitch extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Washing Machine.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_WhiteGood_WashingMachine", label = "Washing Machine", synonyms = "Washing Machines", description = "")
public interface WashingMachine extends WhiteGood {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Weather Service.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_WebService_WeatherService", label = "Weather Service", synonyms = "Weather Services", description = "")
public interface WeatherService extends WebService {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Web Service.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_WebService", label = "Web Service", synonyms = "Web Services", description = "")
public interface WebService extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a White Good.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_WhiteGood", label = "White Good", synonyms = "White Goods", description = "")
public interface WhiteGood extends Equipment {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.equipment;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Equipment;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Window.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Equipment_Window", label = "Window", synonyms = "Windows", description = "")
public interface Window extends Equipment {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines an Apartment.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Apartment", label = "Apartment", synonyms = "Apartments", description = "")
public interface Apartment extends Indoor {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines an Attic.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Floor_Attic", label = "Attic", synonyms = "Attics", description = "")
public interface Attic extends Floor {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Basement.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Floor_Basement", label = "Basement", synonyms = "Basements", description = "")
public interface Basement extends Floor {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Bathroom.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Room_Bathroom", label = "Bathroom", synonyms = "Bathrooms, Bath, Baths, Powder Room, Powder Rooms", description = "")
public interface Bathroom extends Room {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Bedroom.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Room_Bedroom", label = "Bedroom", synonyms = "Bedrooms", description = "")
public interface Bedroom extends Room {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Boiler Room.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Room_BoilerRoom", label = "Boiler Room", synonyms = "Boiler Rooms", description = "")
public interface BoilerRoom extends Room {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Building.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Building", label = "Building", synonyms = "Buildings", description = "")
public interface Building extends Indoor {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Carport.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Outdoor_Carport", label = "Carport", synonyms = "Carports", description = "")
public interface Carport extends Outdoor {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Cellar.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Room_Cellar", label = "Cellar", synonyms = "Cellars", description = "")
public interface Cellar extends Room {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Corridor.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Corridor", label = "Corridor", synonyms = "Corridors, Hallway, Hallways", description = "")
public interface Corridor extends Indoor {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Dining Room.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Room_DiningRoom", label = "Dining Room", synonyms = "Dining Rooms", description = "")
public interface DiningRoom extends Room {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Driveway.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Outdoor_Driveway", label = "Driveway", synonyms = "Driveways", description = "")
public interface Driveway extends Outdoor {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines an Entry.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Room_Entry", label = "Entry", synonyms = "Entries, Foyer, Foyers", description = "")
public interface Entry extends Room {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Family Room.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Room_FamilyRoom", label = "Family Room", synonyms = "Family Rooms", description = "")
public interface FamilyRoom extends Room {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a First Floor.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Floor_FirstFloor", label = "First Floor", synonyms = "First Floors, Upstairs", description = "")
public interface FirstFloor extends Floor {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Floor.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Floor", label = "Floor", synonyms = "Floors", description = "")
public interface Floor extends Indoor {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Garage.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Building_Garage", label = "Garage", synonyms = "Garages", description = "")
public interface Garage extends Building {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Garden.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Outdoor_Garden", label = "Garden", synonyms = "Gardens", description = "")
public interface Garden extends Outdoor {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Ground Floor.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Floor_GroundFloor", label = "Ground Floor", synonyms = "Ground Floors, Downstairs", description = "")
public interface GroundFloor extends Floor {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a Guest Room.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Room_GuestRoom", label = "Guest Room", synonyms = "Guest Rooms", description = "")
public interface GuestRoom extends Room {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines a House.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor_Building_House", label = "House", synonyms = "Houses", description = "")
public interface House extends Building {
}

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) 2010-2023 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.semantics.model.location;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.semantics.Location;
import org.openhab.core.semantics.TagInfo;
/**
* This class defines an Indoor.
*
* @author Generated from generateTagClasses.groovy - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "Location_Indoor", label = "Indoor", synonyms = "", description = "Anything that is inside a closed building")
public interface Indoor extends Location {
}

Some files were not shown because too many files have changed in this diff Show More