diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsChannelTypeProvider.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsChannelTypeProvider.java index b57157b1f69..78c04b19569 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsChannelTypeProvider.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsChannelTypeProvider.java @@ -37,7 +37,8 @@ import org.openhab.core.thing.type.ChannelType; import org.openhab.core.thing.type.ChannelTypeBuilder; import org.openhab.core.thing.type.ChannelTypeProvider; import org.openhab.core.thing.type.ChannelTypeUID; -import org.openhab.core.types.StateDescription; +import org.openhab.core.types.StateDescriptionFragment; +import org.openhab.core.types.StateDescriptionFragmentBuilder; import org.openhab.core.types.StateOption; import org.osgi.service.component.ComponentContext; import org.osgi.service.component.annotations.Activate; @@ -322,7 +323,7 @@ public class DsChannelTypeProvider extends BaseDsI18n implements ChannelTypeProv return null; } - private StateDescription getSensorStateDescription(SensorEnum sensorType) { + private StateDescriptionFragment getSensorStateDescription(SensorEnum sensorType) { // the digitalSTROM resolution for temperature in kelvin is not correct but sensor-events and cached values are // shown in °C so we will use this unit for temperature sensors String unitShortCut = sensorType.getUnitShortcut(); @@ -332,14 +333,15 @@ public class DsChannelTypeProvider extends BaseDsI18n implements ChannelTypeProv if (sensorType.toString().contains("TEMPERATURE")) { unitShortCut = "°C"; } - return new StateDescription(null, null, null, sensorType.getPattern() + " " + unitShortCut, true, null); + return StateDescriptionFragmentBuilder.create().withPattern(sensorType.getPattern() + " " + unitShortCut) + .withReadOnly(true).build(); } private String getStageChannelOption(String type, String option) { return buildIdentifier(type, STAGE, OPTION, option); } - private StateDescription getStageDescription(String channelID, Locale locale) { + private StateDescriptionFragment getStageDescription(String channelID, Locale locale) { if (channelID.contains(STAGE.toLowerCase())) { List stateOptions = new ArrayList<>(); if (channelID.contains(LIGHT)) { @@ -369,11 +371,12 @@ public class DsChannelTypeProvider extends BaseDsI18n implements ChannelTypeProv locale))); } } - return new StateDescription(null, null, null, null, false, stateOptions); + return StateDescriptionFragmentBuilder.create().withReadOnly(false).withOptions(stateOptions).build(); } if (channelID.contains(TEMPERATURE_CONTROLLED)) { - return new StateDescription(new BigDecimal(0), new BigDecimal(50), new BigDecimal(0.1), "%.1f °C", false, - null); + return StateDescriptionFragmentBuilder.create().withMinimum(new BigDecimal(0)) + .withMaximum(new BigDecimal(50)).withStep(new BigDecimal(0.1)).withPattern("%.1f °C") + .withReadOnly(false).build(); } return null; } @@ -485,14 +488,14 @@ public class DsChannelTypeProvider extends BaseDsI18n implements ChannelTypeProv return ChannelTypeBuilder.state(channelTypeUID, getLabelText(channelID, locale), NUMBER) .withDescription(getDescText(channelID, locale)).withCategory(getSensorCategory(sensorType)) .withTags(getSimpleTags(channelID, locale)) - .withStateDescription(getSensorStateDescription(sensorType)).build(); + .withStateDescriptionFragment(getSensorStateDescription(sensorType)).build(); } catch (IllegalArgumentException e) { if (SUPPORTED_OUTPUT_CHANNEL_TYPES.contains(channelID)) { return ChannelTypeBuilder .state(channelTypeUID, getLabelText(channelID, locale), getItemType(channelID)) .withDescription(getDescText(channelID, locale)).withCategory(getCategory(channelID)) .withTags(getTags(channelID, locale)) - .withStateDescription(getStageDescription(channelID, locale)).build(); + .withStateDescriptionFragment(getStageDescription(channelID, locale)).build(); } MeteringTypeEnum meteringType = getMeteringType(channelID); if (meteringType != null) { @@ -501,11 +504,14 @@ public class DsChannelTypeProvider extends BaseDsI18n implements ChannelTypeProv if (MeteringTypeEnum.CONSUMPTION.equals(meteringType)) { pattern = "%d W"; } + return ChannelTypeBuilder.state(channelTypeUID, getLabelText(channelID, locale), NUMBER) .withDescription(getDescText(channelID, locale)).withCategory(CATEGORY_ENERGY) .withTags( new HashSet<>(Arrays.asList(getLabelText(channelID, locale), getText(DS, locale)))) - .withStateDescription(new StateDescription(null, null, null, pattern, true, null)).build(); + .withStateDescriptionFragment(StateDescriptionFragmentBuilder.create().withPattern(pattern) + .withReadOnly(true).build()) + .build(); } try { DeviceBinarayInputEnum binarayInputType = DeviceBinarayInputEnum @@ -514,8 +520,9 @@ public class DsChannelTypeProvider extends BaseDsI18n implements ChannelTypeProv .state(channelTypeUID, getLabelText(channelID, locale), getItemType(channelID)) .withDescription(getDescText(channelID, locale)) .withCategory(getBinaryInputCategory(binarayInputType)) - .withTags(getSimpleTags(channelTypeUID.getId(), locale)) - .withStateDescription(new StateDescription(null, null, null, null, true, null)).build(); + .withTags(getSimpleTags(channelTypeUID.getId(), locale)).withStateDescriptionFragment( + StateDescriptionFragmentBuilder.create().withReadOnly(true).build()) + .build(); } catch (IllegalArgumentException e1) { // ignore } diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyDeviceHandler.java b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyDeviceHandler.java index 6ad929c511a..5d788bf9fba 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyDeviceHandler.java +++ b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyDeviceHandler.java @@ -41,7 +41,7 @@ import org.openhab.core.thing.type.ChannelTypeBuilder; import org.openhab.core.thing.type.ChannelTypeUID; import org.openhab.core.types.Command; import org.openhab.core.types.RefreshType; -import org.openhab.core.types.StateDescription; +import org.openhab.core.types.StateDescriptionFragmentBuilder; import org.openhab.core.types.StateOption; import org.openhab.core.types.UnDefType; import org.slf4j.Logger; @@ -187,7 +187,8 @@ public class HarmonyDeviceHandler extends BaseThingHandler { ChannelType channelType = ChannelTypeBuilder.state(channelTypeUID, "Send Button Press", "String") .withDescription("Send a button press to device " + getThing().getLabel()) - .withStateDescription(new StateDescription(null, null, null, null, false, states)).build(); + .withStateDescriptionFragment(StateDescriptionFragmentBuilder.create().withOptions(states).build()) + .build(); factory.addChannelType(channelType); diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyHubHandler.java b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyHubHandler.java index 804fe3af6de..bbfa099ab5f 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyHubHandler.java +++ b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyHubHandler.java @@ -50,7 +50,7 @@ import org.openhab.core.thing.type.ChannelTypeBuilder; import org.openhab.core.thing.type.ChannelTypeUID; import org.openhab.core.types.Command; import org.openhab.core.types.RefreshType; -import org.openhab.core.types.StateDescription; +import org.openhab.core.types.StateDescriptionFragmentBuilder; import org.openhab.core.types.StateOption; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -382,7 +382,9 @@ public class HarmonyHubHandler extends BaseBridgeHandler implements HarmonyClien ChannelType channelType = ChannelTypeBuilder.state(channelTypeUID, "Current Activity", "String") .withDescription("Current activity for " + getThing().getLabel()) - .withStateDescription(new StateDescription(null, null, null, "%s", false, states)).build(); + .withStateDescriptionFragment(StateDescriptionFragmentBuilder.create().withPattern("%s") + .withReadOnly(false).withOptions(states).build()) + .build(); factory.addChannelType(channelType); 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 eb771ddab21..8b170faa788 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 @@ -189,7 +189,7 @@ public class KM200ThingHandler extends BaseThingHandler { .withDescription(description) // .withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())) // .withTags(checkTags(unitOfMeasure, state.isReadOnly())) // - .withStateDescription(state.toStateDescription()) // + .withStateDescriptionFragment(state) // .withConfigDescriptionURI(configDescriptionUriChannel).build(); } catch (URISyntaxException ex) { logger.warn("Can't create ConfigDescription URI '{}', ConfigDescription for channels not avilable!", diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CChannel.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CChannel.java index 67a78909b7b..5ec45732c6d 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CChannel.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CChannel.java @@ -38,7 +38,7 @@ import org.openhab.core.thing.type.ChannelDefinitionBuilder; import org.openhab.core.thing.type.ChannelType; import org.openhab.core.thing.type.ChannelTypeBuilder; import org.openhab.core.thing.type.ChannelTypeUID; -import org.openhab.core.types.StateDescription; +import org.openhab.core.types.StateDescriptionFragment; /** * An {@link AbstractComponent}s derived class consists of one or multiple channels. @@ -208,11 +208,10 @@ public class CChannel { type = ChannelTypeBuilder.trigger(channelTypeUID, label) .withConfigDescriptionURI(URI.create(MqttBindingConstants.CONFIG_HA_CHANNEL)).build(); } else { - StateDescription description = valueState.createStateDescription(command_topic == null).build() - .toStateDescription(); + StateDescriptionFragment description = valueState.createStateDescription(command_topic == null).build(); type = ChannelTypeBuilder.state(channelTypeUID, label, channelState.getItemType()) .withConfigDescriptionURI(URI.create(MqttBindingConstants.CONFIG_HA_CHANNEL)) - .withStateDescription(description).build(); + .withStateDescriptionFragment(description).build(); } Configuration configuration = new Configuration(); diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java index 277b2c74dd8..862bd10eafc 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java @@ -142,8 +142,8 @@ public class Property implements AttributeChanged { if (attributes.retained) { return ChannelTypeBuilder.state(channelTypeUID, attributes.name, channelState.getItemType()) .withConfigDescriptionURI(URI.create(MqttBindingConstants.CONFIG_HOMIE_CHANNEL)) - .withStateDescription(channelState.getCache().createStateDescription(!attributes.settable).build() - .toStateDescription()) + .withStateDescriptionFragment( + channelState.getCache().createStateDescription(!attributes.settable).build()) .build(); } else { // Non-retained and settable property -> State channel diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTDynamicChannelFactory.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTDynamicChannelFactory.java index 7ce7a25a5b7..f08fc1c13e4 100644 --- a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTDynamicChannelFactory.java +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTDynamicChannelFactory.java @@ -113,7 +113,7 @@ class NUTDynamicChannelFactory { final ChannelTypeUID channelTypeUID = new ChannelTypeUID(BINDING_ID, channel.getUID().getId() + "Type"); final String label = channel.getLabel(); final ChannelType channelType = ChannelTypeBuilder.state(channelTypeUID, label == null ? "" : label, itemType) - .withStateDescription(sdb.withReadOnly(Boolean.TRUE).build().toStateDescription()) + .withStateDescriptionFragment(sdb.withReadOnly(Boolean.TRUE).build()) .withConfigDescriptionURI(NUTBindingConstants.DYNAMIC_CHANNEL_CONFIG_QUANTITY_TYPE).build(); channelTypeProvider.addChannelType(channelType); return channelTypeUID; diff --git a/bundles/org.openhab.binding.sensibo/src/main/java/org/openhab/binding/sensibo/internal/handler/SensiboSkyHandler.java b/bundles/org.openhab.binding.sensibo/src/main/java/org/openhab/binding/sensibo/internal/handler/SensiboSkyHandler.java index ff765a25c5e..93e36d16d69 100644 --- a/bundles/org.openhab.binding.sensibo/src/main/java/org/openhab/binding/sensibo/internal/handler/SensiboSkyHandler.java +++ b/bundles/org.openhab.binding.sensibo/src/main/java/org/openhab/binding/sensibo/internal/handler/SensiboSkyHandler.java @@ -389,7 +389,7 @@ public class SensiboSkyHandler extends SensiboBaseThingHandler implements Channe stateDescription = stateDescription.withPattern(pattern); } final StateChannelTypeBuilder builder = ChannelTypeBuilder.state(channelTypeUID, label, itemType) - .withStateDescription(stateDescription.build().toStateDescription()); + .withStateDescriptionFragment(stateDescription.build()); if (tag != null) { builder.withTag(tag); } diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterChannelTypeProvider.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterChannelTypeProvider.java index 802bc4270fe..d3adba2dc90 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterChannelTypeProvider.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterChannelTypeProvider.java @@ -83,16 +83,14 @@ public class SmartMeterChannelTypeProvider implements ChannelTypeProvider, Meter stateDescriptionBuilder = ChannelTypeBuilder .state(new ChannelTypeUID(SmartMeterBindingConstants.BINDING_ID, obisChannelId), obis, CoreItemFactory.NUMBER + ":" + dimension) - .withStateDescription(StateDescriptionFragmentBuilder.create().withReadOnly(true) - .withPattern("%.2f %unit%").build().toStateDescription()) + .withStateDescriptionFragment(StateDescriptionFragmentBuilder.create().withReadOnly(true) + .withPattern("%.2f %unit%").build()) .withConfigDescriptionURI(URI.create(SmartMeterBindingConstants.CHANNEL_TYPE_METERREADER_OBIS)); } else { stateDescriptionBuilder = ChannelTypeBuilder .state(new ChannelTypeUID(SmartMeterBindingConstants.BINDING_ID, obisChannelId), obis, CoreItemFactory.STRING) - .withStateDescription( - StateDescriptionFragmentBuilder.create().withReadOnly(true).build().toStateDescription()); - + .withStateDescriptionFragment(StateDescriptionFragmentBuilder.create().withReadOnly(true).build()); } return stateDescriptionBuilder.build(); } diff --git a/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/schema/ApiPageParser.java b/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/schema/ApiPageParser.java index 872e2b0e9d3..58534bc809f 100644 --- a/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/schema/ApiPageParser.java +++ b/bundles/org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/schema/ApiPageParser.java @@ -469,8 +469,8 @@ public class ApiPageParser extends AbstractSimpleMarkupHandler { } ChannelType ct = ChannelTypeBuilder .state(new ChannelTypeUID(TACmiBindingConstants.BINDING_ID, shortName), shortName, itemType) - .withDescription("Auto-created for " + shortName) - .withStateDescription(sdb.build().toStateDescription()).build(); + .withDescription("Auto-created for " + shortName).withStateDescriptionFragment(sdb.build()) + .build(); channelTypeProvider.addChannelType(ct); channelBuilder.withType(ct.getUID()); } else { diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderAvailableInputs.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderAvailableInputs.java index 4f46ac88c3a..b27bb2a9c30 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderAvailableInputs.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderAvailableInputs.java @@ -31,7 +31,8 @@ import org.openhab.core.thing.type.ChannelType; import org.openhab.core.thing.type.ChannelTypeBuilder; import org.openhab.core.thing.type.ChannelTypeProvider; import org.openhab.core.thing.type.ChannelTypeUID; -import org.openhab.core.types.StateDescription; +import org.openhab.core.types.StateDescriptionFragment; +import org.openhab.core.types.StateDescriptionFragmentBuilder; import org.openhab.core.types.StateOption; /** @@ -64,12 +65,12 @@ public class ChannelsTypeProviderAvailableInputs implements ChannelTypeProvider, return channelTypeUID; } - private void createChannelType(StateDescription state) { + private void createChannelType(StateDescriptionFragment state) { channelType = ChannelTypeBuilder.state(channelTypeUID, "Input source", "String") - .withDescription("Select the input source of the AVR").withStateDescription(state).build(); + .withDescription("Select the input source of the AVR").withStateDescriptionFragment(state).build(); } - private StateDescription getDefaultStateDescription() { + private StateDescriptionFragment getDefaultStateDescription() { List options = new ArrayList<>(); options.add(new StateOption(INPUT_NET_RADIO, "Net Radio")); options.add(new StateOption(INPUT_PC, "PC")); @@ -110,8 +111,8 @@ public class ChannelsTypeProviderAvailableInputs implements ChannelTypeProvider, options.add(new StateOption(INPUT_PANDORA, "Pandora")); options.add(new StateOption(INPUT_NAPSTER, "Napster")); options.add(new StateOption(INPUT_SPOTIFY, "Spotify")); - StateDescription state = new StateDescription(null, null, null, "%s", false, options); - return state; + return StateDescriptionFragmentBuilder.create().withPattern("%s").withReadOnly(false).withOptions(options) + .build(); } public void changeAvailableInputs(Map availableInputs) { @@ -119,7 +120,8 @@ public class ChannelsTypeProviderAvailableInputs implements ChannelTypeProvider, for (Entry inputEntry : availableInputs.entrySet()) { options.add(new StateOption(inputEntry.getKey(), inputEntry.getValue())); } - createChannelType(new StateDescription(null, null, null, "%s", false, options)); + createChannelType(StateDescriptionFragmentBuilder.create().withPattern("%s").withReadOnly(false) + .withOptions(options).build()); } @NonNullByDefault({}) diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderPreset.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderPreset.java index 1346e889021..2e4f5210c50 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderPreset.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderPreset.java @@ -31,7 +31,8 @@ import org.openhab.core.thing.type.ChannelType; import org.openhab.core.thing.type.ChannelTypeBuilder; import org.openhab.core.thing.type.ChannelTypeProvider; import org.openhab.core.thing.type.ChannelTypeUID; -import org.openhab.core.types.StateDescription; +import org.openhab.core.types.StateDescriptionFragment; +import org.openhab.core.types.StateDescriptionFragmentBuilder; import org.openhab.core.types.StateOption; /** @@ -64,25 +65,24 @@ public class ChannelsTypeProviderPreset implements ChannelTypeProvider, ThingHan return channelTypeUID; } - private StateDescription getDefaultStateDescription() { + private StateDescriptionFragment getDefaultStateDescription() { List options = IntStream.rangeClosed(1, 40) .mapToObj(i -> new StateOption(Integer.toString(i), "Item_" + i)).collect(toList()); - - StateDescription state = new StateDescription(null, null, null, "%s", false, options); - return state; + return StateDescriptionFragmentBuilder.create().withPattern("%s").withReadOnly(false).withOptions(options) + .build(); } public void changePresetNames(List presets) { List options = presets.stream() .map(preset -> new StateOption(String.valueOf(preset.getValue()), preset.getName())).collect(toList()); - - StateDescription state = new StateDescription(null, null, null, "%s", false, options); - createChannelType(state); + createChannelType(StateDescriptionFragmentBuilder.create().withPattern("%s").withReadOnly(false) + .withOptions(options).build()); } - private void createChannelType(StateDescription state) { + private void createChannelType(StateDescriptionFragment state) { channelType = ChannelTypeBuilder.state(channelTypeUID, "Preset", "Number") - .withDescription("Select a saved channel by its preset number").withStateDescription(state).build(); + .withDescription("Select a saved channel by its preset number").withStateDescriptionFragment(state) + .build(); } @NonNullByDefault({}) @@ -96,8 +96,7 @@ public class ChannelsTypeProviderPreset implements ChannelTypeProvider, ThingHan channelTypeUID = new ChannelTypeUID(BINDING_ID, CHANNEL_PLAYBACK_PRESET_TYPE_NAMED + handler.getThing().getUID().getId()); - StateDescription state = getDefaultStateDescription(); - createChannelType(state); + createChannelType(getDefaultStateDescription()); } @Override