Skip to content

Commit

Permalink
[km200] removed unused configuration URIs (openhab#14488)
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Eckhardt <github@familie-eckhardt.eu>
  • Loading branch information
Markinus authored Feb 26, 2023
1 parent 984914f commit 0675a80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
public class KM200BindingConstants {

public static final String BINDING_ID = "km200";
public static final String CONFIG_DESCRIPTION_URI_CHANNEL = "channel-type:km200:config";
public static final String CONFIG_DESCRIPTION_URI_THING = "thing-type:km200:config";

// Bridge UID
public static final ThingTypeUID THING_TYPE_KMDEVICE = new ThingTypeUID(BINDING_ID, "kmdevice");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -149,7 +147,6 @@ String checkCategory(String unitOfMeasure, String topCategory, @Nullable Boolean
Channel createChannel(ChannelTypeUID channelTypeUID, ChannelUID channelUID, String root, String type,
@Nullable String currentPathName, String description, String label, boolean addProperties,
boolean switchProgram, StateDescriptionFragment state, String unitOfMeasure) {
URI configDescriptionUriChannel = null;
Channel newChannel = null;
ChannelType channelType = null;
Map<String, String> chProperties = new HashMap<>();
Expand All @@ -162,20 +159,11 @@ Channel createChannel(ChannelTypeUID channelTypeUID, ChannelUID channelUID, Stri
logger.info("Channeltype {} not supported", type);
return null;
}
try {
configDescriptionUriChannel = new URI(CONFIG_DESCRIPTION_URI_CHANNEL);
channelType = ChannelTypeBuilder.state(channelTypeUID, label, type) //
.withDescription(description) //
.withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())) //
.withStateDescriptionFragment(state) //
.withConfigDescriptionURI(configDescriptionUriChannel).build();
} catch (URISyntaxException ex) {
logger.warn("Can't create ConfigDescription URI '{}', ConfigDescription for channels not avilable!",
CONFIG_DESCRIPTION_URI_CHANNEL);
channelType = ChannelTypeBuilder.state(channelTypeUID, label, type) //
.withDescription(description) //
.withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())).build();
}
channelType = ChannelTypeBuilder.state(channelTypeUID, label, type) //
.withDescription(description) //
.withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())) //
.withStateDescriptionFragment(state).build();

channelTypeProvider.addChannelType(channelType);

chProperties.put("root", KM200Utils.translatesPathToName(root));
Expand Down

0 comments on commit 0675a80

Please sign in to comment.