From ac59c96066db98ff0b06406e79165787cc34c4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Ro=C3=9Fner?= Date: Mon, 28 Dec 2020 17:39:11 +0100 Subject: [PATCH] Semantic: Add properties Distance and Angle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Proposal is to add Distance and Angle as additional property this allows to use these basic units for items. Signed-off-by: Michael Roßner --- .../model/SemanticTags.csv | 2 ++ .../core/semantics/model/property/Angle.java | 27 +++++++++++++++++++ .../semantics/model/property/Distance.java | 27 +++++++++++++++++++ .../semantics/model/property/Properties.java | 2 ++ .../src/main/resources/tags.properties | 2 ++ .../src/main/resources/tags_de.properties | 2 ++ .../src/main/resources/tags_fr.properties | 2 ++ .../src/main/resources/tags_nl.properties | 2 ++ .../src/main/resources/tags_no.properties | 2 ++ .../src/main/resources/tags_pl.properties | 2 ++ 10 files changed, 70 insertions(+) create mode 100644 bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Angle.java create mode 100644 bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Distance.java diff --git a/bundles/org.openhab.core.semantics/model/SemanticTags.csv b/bundles/org.openhab.core.semantics/model/SemanticTags.csv index ae8b1df6c4b..6ec05b0c31e 100644 --- a/bundles/org.openhab.core.semantics/model/SemanticTags.csv +++ b/bundles/org.openhab.core.semantics/model/SemanticTags.csv @@ -62,6 +62,8 @@ Property,Opening,,Opening,, Property,Timestamp,,Timestamp,, Property,Ultraviolet,,Ultraviolet,UV, Property,Vibration,,Vibration,, +Property,Distance,,Distance,Length, +Property,Angle,,Angle,Gradient, Point,Alarm,,Alarm,, Point,Control,,Control,, Point,Switch,Control,Switch,, diff --git a/bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Angle.java b/bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Angle.java new file mode 100644 index 00000000000..890f60cc643 --- /dev/null +++ b/bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Angle.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2010-2020 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.property; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.semantics.model.Property; +import org.openhab.core.semantics.model.TagInfo; + +/** + * This class defines a Angle. + * + * @author Generated from generateTagClasses.groovy - Initial contribution + */ +@NonNullByDefault +@TagInfo(id = "Property_Angle", label = "Angle", synonyms = "Gradient", description = "") +public interface Angle extends Property { +} diff --git a/bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Distance.java b/bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Distance.java new file mode 100644 index 00000000000..e913ed55010 --- /dev/null +++ b/bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Distance.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2010-2020 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.property; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.semantics.model.Property; +import org.openhab.core.semantics.model.TagInfo; + +/** + * This class defines a Distance. + * + * @author Generated from generateTagClasses.groovy - Initial contribution + */ +@NonNullByDefault +@TagInfo(id = "Property_Distance", label = "Distance", synonyms = "Length", description = "") +public interface Distance extends Property { +} diff --git a/bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Properties.java b/bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Properties.java index 0179b32615f..41e24adfc87 100644 --- a/bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Properties.java +++ b/bundles/org.openhab.core.semantics/src/main/java/org/openhab/core/semantics/model/property/Properties.java @@ -31,10 +31,12 @@ public class Properties { static { PROPERTIES.add(Property.class); + PROPERTIES.add(Angle.class); PROPERTIES.add(CO.class); PROPERTIES.add(CO2.class); PROPERTIES.add(ColorTemperature.class); PROPERTIES.add(Current.class); + PROPERTIES.add(Distance.class); PROPERTIES.add(Duration.class); PROPERTIES.add(Energy.class); PROPERTIES.add(Frequency.class); diff --git a/bundles/org.openhab.core.semantics/src/main/resources/tags.properties b/bundles/org.openhab.core.semantics/src/main/resources/tags.properties index 946cf762bf0..9ce9403bd69 100644 --- a/bundles/org.openhab.core.semantics/src/main/resources/tags.properties +++ b/bundles/org.openhab.core.semantics/src/main/resources/tags.properties @@ -62,6 +62,8 @@ Property_Opening=Opening Property_Timestamp=Timestamp Property_Ultraviolet=Ultraviolet,UV Property_Vibration=Vibration +Property_Distance=Distance,Length +Property_Angle=Angle,Gradient Point_Alarm=Alarm Point_Control=Control Point_Control_Switch=Switch diff --git a/bundles/org.openhab.core.semantics/src/main/resources/tags_de.properties b/bundles/org.openhab.core.semantics/src/main/resources/tags_de.properties index bf676c3043e..7799cb30e6f 100644 --- a/bundles/org.openhab.core.semantics/src/main/resources/tags_de.properties +++ b/bundles/org.openhab.core.semantics/src/main/resources/tags_de.properties @@ -61,6 +61,8 @@ Property_Opening=Er Property_Timestamp=Zeitpunkt,Zeitpunkte Property_Ultraviolet=Ultraviolett Property_Vibration=Vibration,Vibrationen +Property_Distance=Entfernung,Lnge +Property_Angle=Winkel,Gradient Point_Alarm=Alarm,Alarme Point_Control=Regler,Bedienung,Steuerung Point_Control_Switch=Schalter diff --git a/bundles/org.openhab.core.semantics/src/main/resources/tags_fr.properties b/bundles/org.openhab.core.semantics/src/main/resources/tags_fr.properties index 0fb471ecfe8..930fae5c565 100644 --- a/bundles/org.openhab.core.semantics/src/main/resources/tags_fr.properties +++ b/bundles/org.openhab.core.semantics/src/main/resources/tags_fr.properties @@ -61,6 +61,8 @@ Property_Opening=ouverture Property_Timestamp=horodatage,heure Property_Ultraviolet=Ultraviolet,UV Property_Vibration=Vibration +Property_Distance=Distance +Property_Angle=Angle Point_Alarm=alarme,alarmes Point_Control=contrle,contrles Point_Control_Switch=interrupteurs diff --git a/bundles/org.openhab.core.semantics/src/main/resources/tags_nl.properties b/bundles/org.openhab.core.semantics/src/main/resources/tags_nl.properties index ff657e527b6..7abb1147dee 100644 --- a/bundles/org.openhab.core.semantics/src/main/resources/tags_nl.properties +++ b/bundles/org.openhab.core.semantics/src/main/resources/tags_nl.properties @@ -61,6 +61,8 @@ Property_Opening=Openen Property_Timestamp=Tijdstempel,Tijdsaanduiding Property_Ultraviolet=Ultraviolet,UV Property_Vibration=Vibratie +Property_Distance=Afstand +Property_Angle=Hoek Point_Alarm=Alarm Point_Control=Regelaar Point_Control_Switch=Schakelaar diff --git a/bundles/org.openhab.core.semantics/src/main/resources/tags_no.properties b/bundles/org.openhab.core.semantics/src/main/resources/tags_no.properties index 19efde74dd9..244a3b443b7 100644 --- a/bundles/org.openhab.core.semantics/src/main/resources/tags_no.properties +++ b/bundles/org.openhab.core.semantics/src/main/resources/tags_no.properties @@ -61,6 +61,8 @@ Property_Opening=xxx Property_Timestamp=xxx Property_Ultraviolet=xxx Property_Vibration=xxx +Property_Distance=Avstand +Property_Angle=Vinkel Point_Alarm=Alarm Point_Control=Kontroll Point_Control_Switch=Bryter diff --git a/bundles/org.openhab.core.semantics/src/main/resources/tags_pl.properties b/bundles/org.openhab.core.semantics/src/main/resources/tags_pl.properties index 01cfb7eea1e..f96c59788ee 100644 --- a/bundles/org.openhab.core.semantics/src/main/resources/tags_pl.properties +++ b/bundles/org.openhab.core.semantics/src/main/resources/tags_pl.properties @@ -61,6 +61,8 @@ Property_Opening=xxx Property_Timestamp=xxx Property_Ultraviolet=xxx Property_Vibration=xxx +Property_Distance=Dystans +Property_Angle=Kąt Point_Alarm=Alarm,Alarmu,alarmowy Point_Control=Kontrola,Zarządzanie Point_Control_Switch=Przełącznik,Włącznik,Łącznik,Przycisk