Skip to content

Commit

Permalink
Refactoring to dynamic channel creation
Browse files Browse the repository at this point in the history
Refactoring to dynamic channel creation

Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
  • Loading branch information
andrasU committed Nov 12, 2022
1 parent 8f0d6a4 commit a5aaa19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,11 @@ public void updateChannels() {
ChannelUID channelUID = UidUtils.generateChannelUID(thingUID, device.getDeviceId(),
channel.getChannelId(), dpg.getLabel());

String channelLabel = String.format("%s - %s", channel.getFunctionIdText(), dpg.getLabel());
String channelLabel = String.format("%s - %s - %s", channel.getChannelLabel(),
channel.getFunctionIdText(), dpg.getLabel());

Channel thingChannel = ChannelBuilder.create(channelUID)
.withAcceptedItemType(dpg.getOpenHabItemType()).withKind(ChannelKind.TRIGGER)
.withAcceptedItemType(dpg.getOpenHabItemType()).withKind(ChannelKind.STATE)
.withProperties(channelProps).withLabel(channelLabel).withDescription(dpg.getDescription())
.withType(channelTypeUID).build();
thingChannels.add(thingChannel);
Expand Down

0 comments on commit a5aaa19

Please sign in to comment.