mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Fix Semantics default synonyms (#3511)
Fix incorrect Property id Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This commit is contained in:
+1
-1
@@ -20,6 +20,6 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
* @author Kai Kreuzer - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
@TagInfo(id = "MeasurementProperty")
|
||||
@TagInfo(id = "Property")
|
||||
public interface Property extends Tag {
|
||||
}
|
||||
|
||||
+5
-1
@@ -22,6 +22,7 @@ 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;
|
||||
@@ -84,7 +85,10 @@ public class SemanticTags {
|
||||
String entry = rb.getString(tag.getAnnotation(TagInfo.class).id());
|
||||
return List.of(entry.toLowerCase(locale).split(","));
|
||||
} catch (MissingResourceException e) {
|
||||
return List.of(tag.getAnnotation(TagInfo.class).label());
|
||||
TagInfo tagInfo = tag.getAnnotation(TagInfo.class);
|
||||
Stream<String> label = Stream.of(tagInfo.label());
|
||||
Stream<String> synonyms = Stream.of(tagInfo.synonyms().split(","));
|
||||
return Stream.concat(label, synonyms).map(s -> s.toLowerCase(locale)).distinct().toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user