Skip to content

Commit

Permalink
Fix wrong context
Browse files Browse the repository at this point in the history
Signed-off-by: Jan N. Klug <[email protected]>
  • Loading branch information
J-N-K committed Jul 19, 2023
1 parent 061c836 commit 95561e8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,13 @@ private ProfileCallback createCallback(ItemChannelLink link) {
if (item != null && thing != null) {
Channel channel = thing.getChannel(link.getLinkedUID());
if (channel != null) {
String acceptedItemType = Objects.requireNonNull(channel.getAcceptedItemType(), "");
if (acceptedItemType.startsWith("Number")) {
acceptedItemType = "Number";
}
context = new ProfileContextImpl(link.getConfiguration(), item.getAcceptedDataTypes(),
item.getAcceptedCommandTypes(), acceptedCommandTypeMap.getOrDefault(
Objects.requireNonNullElse(channel.getAcceptedItemType(), ""), List.of()));
item.getAcceptedCommandTypes(),
acceptedCommandTypeMap.getOrDefault(acceptedItemType, List.of()));
}
}

Expand Down

0 comments on commit 95561e8

Please sign in to comment.