diff --git a/bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/internal/items/ItemUIRegistryImpl.java b/bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/internal/items/ItemUIRegistryImpl.java index c349c098a2a..c8884f28be1 100644 --- a/bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/internal/items/ItemUIRegistryImpl.java +++ b/bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/internal/items/ItemUIRegistryImpl.java @@ -283,6 +283,9 @@ private void applyConfig(@Nullable Map config) { } if (!isReadOnly && hasStateOptions(itemName)) { return SitemapFactory.eINSTANCE.createSelection(); + } + if (!isReadOnly && NumberItem.class.isAssignableFrom(itemType) && hasItemTag(itemName, "Setpoint")) { + return SitemapFactory.eINSTANCE.createSetpoint(); } else { return SitemapFactory.eINSTANCE.createText(); } @@ -856,6 +859,15 @@ private int getCommandOptionsSize(String itemName) { } } + private boolean hasItemTag(String itemName, String tag) { + try { + Item item = getItem(itemName); + return item.hasTag(tag); + } catch (ItemNotFoundException e) { + return false; + } + } + @Override public Item getItem(String name) throws ItemNotFoundException { return itemRegistry.getItem(name);