[intesis] Fix channel state options not set when channel exists (#8963)
Signed-off-by: Hans-Jörg Merk <github@hmerk.de>
This commit is contained in:
parent
ffc48e498d
commit
39cb4fcaa3
@ -347,16 +347,14 @@ public class IntesisBoxHandler extends BaseThingHandler implements IntesisBoxCha
|
|||||||
.withType(channelTypeUID).withKind(ChannelKind.STATE).build();
|
.withType(channelTypeUID).withKind(ChannelKind.STATE).build();
|
||||||
thingBuilder.withChannel(channel);
|
thingBuilder.withChannel(channel);
|
||||||
updateThing(thingBuilder.build());
|
updateThing(thingBuilder.build());
|
||||||
|
}
|
||||||
if (limits.containsKey(channelId)) {
|
if (limits.containsKey(channelId)) {
|
||||||
List<StateOption> options = new ArrayList<>();
|
List<StateOption> options = new ArrayList<>();
|
||||||
for (String mode : limits.get(channelId)) {
|
for (String mode : limits.get(channelId)) {
|
||||||
options.add(new StateOption(mode,
|
options.add(
|
||||||
mode.substring(0, 1).toUpperCase() + mode.substring(1).toLowerCase()));
|
new StateOption(mode, mode.substring(0, 1).toUpperCase() + mode.substring(1).toLowerCase()));
|
||||||
}
|
|
||||||
intesisStateDescriptionProvider.setStateOptions(new ChannelUID(getThing().getUID(), channelId),
|
|
||||||
options);
|
|
||||||
}
|
}
|
||||||
|
intesisStateDescriptionProvider.setStateOptions(new ChannelUID(getThing().getUID(), channelId), options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -262,14 +262,14 @@ public class IntesisHomeHandler extends BaseThingHandler {
|
|||||||
.withType(channelTypeUID).withKind(ChannelKind.STATE).build();
|
.withType(channelTypeUID).withKind(ChannelKind.STATE).build();
|
||||||
thingBuilder.withChannel(channel);
|
thingBuilder.withChannel(channel);
|
||||||
updateThing(thingBuilder.build());
|
updateThing(thingBuilder.build());
|
||||||
|
}
|
||||||
if (options != null) {
|
if (options != null) {
|
||||||
final List<StateOption> stateOptions = options.stream()
|
final List<StateOption> stateOptions = options.stream()
|
||||||
.map(e -> new StateOption(e, e.substring(0, 1) + e.substring(1).toLowerCase()))
|
.map(e -> new StateOption(e, e.substring(0, 1) + e.substring(1).toLowerCase()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
logger.trace("StateOptions : '{}'", stateOptions);
|
logger.trace("StateOptions : '{}'", stateOptions);
|
||||||
intesisStateDescriptionProvider.setStateOptions(channel.getUID(), stateOptions);
|
intesisStateDescriptionProvider.setStateOptions(new ChannelUID(getThing().getUID(), channelId),
|
||||||
}
|
stateOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user