mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[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();
|
||||
thingBuilder.withChannel(channel);
|
||||
updateThing(thingBuilder.build());
|
||||
|
||||
if (limits.containsKey(channelId)) {
|
||||
List<StateOption> options = new ArrayList<>();
|
||||
for (String mode : limits.get(channelId)) {
|
||||
options.add(new StateOption(mode,
|
||||
mode.substring(0, 1).toUpperCase() + mode.substring(1).toLowerCase()));
|
||||
}
|
||||
intesisStateDescriptionProvider.setStateOptions(new ChannelUID(getThing().getUID(), channelId),
|
||||
options);
|
||||
}
|
||||
if (limits.containsKey(channelId)) {
|
||||
List<StateOption> options = new ArrayList<>();
|
||||
for (String mode : limits.get(channelId)) {
|
||||
options.add(
|
||||
new StateOption(mode, mode.substring(0, 1).toUpperCase() + mode.substring(1).toLowerCase()));
|
||||
}
|
||||
intesisStateDescriptionProvider.setStateOptions(new ChannelUID(getThing().getUID(), channelId), options);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -262,14 +262,14 @@ public class IntesisHomeHandler extends BaseThingHandler {
|
||||
.withType(channelTypeUID).withKind(ChannelKind.STATE).build();
|
||||
thingBuilder.withChannel(channel);
|
||||
updateThing(thingBuilder.build());
|
||||
|
||||
if (options != null) {
|
||||
final List<StateOption> stateOptions = options.stream()
|
||||
.map(e -> new StateOption(e, e.substring(0, 1) + e.substring(1).toLowerCase()))
|
||||
.collect(Collectors.toList());
|
||||
logger.trace("StateOptions : '{}'", stateOptions);
|
||||
intesisStateDescriptionProvider.setStateOptions(channel.getUID(), stateOptions);
|
||||
}
|
||||
}
|
||||
if (options != null) {
|
||||
final List<StateOption> stateOptions = options.stream()
|
||||
.map(e -> new StateOption(e, e.substring(0, 1) + e.substring(1).toLowerCase()))
|
||||
.collect(Collectors.toList());
|
||||
logger.trace("StateOptions : '{}'", stateOptions);
|
||||
intesisStateDescriptionProvider.setStateOptions(new ChannelUID(getThing().getUID(), channelId),
|
||||
stateOptions);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user