]> git.basschouten.com Git - openhab-addons.git/commitdiff
[km200] Cleanup semantic tags (#12573)
authorlolodomo <lg.hc@free.fr>
Mon, 4 Apr 2022 21:45:55 +0000 (23:45 +0200)
committerGitHub <noreply@github.com>
Mon, 4 Apr 2022 21:45:55 +0000 (23:45 +0200)
Related to #12262

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ThingHandler.java

index 36b18f30f19c92cf431a831e97478f44992a05a2..11ceeb3a7e2f0059106bc8914e856ca4e6752be9 100644 (file)
@@ -21,7 +21,6 @@ import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -108,23 +107,6 @@ public class KM200ThingHandler extends BaseThingHandler {
         }
     }
 
-    /**
-     * Choose a tag for a channel
-     */
-    Set<String> checkTags(String unitOfMeasure, @Nullable Boolean readOnly) {
-        Set<String> tags = new HashSet<>();
-        if (unitOfMeasure.indexOf("°C") == 0 || unitOfMeasure.indexOf("K") == 0) {
-            if (null != readOnly) {
-                if (readOnly) {
-                    tags.add("CurrentTemperature");
-                } else {
-                    tags.add("TargetTemperature");
-                }
-            }
-        }
-        return tags;
-    }
-
     /**
      * Choose a category for a channel
      */
@@ -188,7 +170,6 @@ public class KM200ThingHandler extends BaseThingHandler {
             channelType = ChannelTypeBuilder.state(channelTypeUID, label, itemType) //
                     .withDescription(description) //
                     .withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())) //
-                    .withTags(checkTags(unitOfMeasure, state.isReadOnly())) //
                     .withStateDescriptionFragment(state) //
                     .withConfigDescriptionURI(configDescriptionUriChannel).build();
         } catch (URISyntaxException ex) {
@@ -196,8 +177,7 @@ public class KM200ThingHandler extends BaseThingHandler {
                     CONFIG_DESCRIPTION_URI_CHANNEL);
             channelType = ChannelTypeBuilder.state(channelTypeUID, label, itemType) //
                     .withDescription(description) //
-                    .withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())) //
-                    .withTags(checkTags(unitOfMeasure, state.isReadOnly())).build();
+                    .withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())).build();
         }
         channelTypeProvider.addChannelType(channelType);