Fix StateDescription deprecations (#9352)

Related to #1408

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2020-12-13 08:53:16 +01:00
committed by GitHub
parent 863606e311
commit 8f53e320dc
12 changed files with 59 additions and 51 deletions

View File

@@ -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;