From bab8e98796f951b6279a1036728495d3f3bedf74 Mon Sep 17 00:00:00 2001 From: lolodomo Date: Sat, 14 May 2022 14:42:56 +0200 Subject: [PATCH] [km200] Fix item type for dynamic channel type (#12732) * [km200] Fix item type for dynamic channel type Related to #12712 Signed-off-by: Laurent Garnier --- .../binding/km200/internal/handler/KM200ThingHandler.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ThingHandler.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ThingHandler.java index 11ceeb3a7..ffc14bda6 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ThingHandler.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ThingHandler.java @@ -153,13 +153,10 @@ public class KM200ThingHandler extends BaseThingHandler { Channel newChannel = null; ChannelType channelType = null; Map chProperties = new HashMap<>(); - String itemType = ""; String category = null; if (CoreItemFactory.NUMBER.equals(type)) { - itemType = "NumberType"; category = "Number"; } else if (CoreItemFactory.STRING.equals(type)) { - itemType = "StringType"; category = "Text"; } else { logger.info("Channeltype {} not supported", type); @@ -167,7 +164,7 @@ public class KM200ThingHandler extends BaseThingHandler { } try { configDescriptionUriChannel = new URI(CONFIG_DESCRIPTION_URI_CHANNEL); - channelType = ChannelTypeBuilder.state(channelTypeUID, label, itemType) // + channelType = ChannelTypeBuilder.state(channelTypeUID, label, type) // .withDescription(description) // .withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())) // .withStateDescriptionFragment(state) // @@ -175,7 +172,7 @@ public class KM200ThingHandler extends BaseThingHandler { } catch (URISyntaxException ex) { logger.warn("Can't create ConfigDescription URI '{}', ConfigDescription for channels not avilable!", CONFIG_DESCRIPTION_URI_CHANNEL); - channelType = ChannelTypeBuilder.state(channelTypeUID, label, itemType) // + channelType = ChannelTypeBuilder.state(channelTypeUID, label, type) // .withDescription(description) // .withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())).build(); }