I’m developing a new Binidng (CarNet), which dynamically creates a bunch of channels. Depending on the vehicle type the set of channels can be quite different so I can’t have a static definition. I also want to use UBM setting the correct units and modify the advance and read-only attributes.
I want to create a channel like this one
<channel-type id="test" advanced="true"> <item-type>Number:Temperature</item-type> <label>Test</label> <state min="1" readOnly="true" pattern="%f %unit%"/> </channel-type>
I’m able to create the channels with the following code
Channel channel = ChannelBuilder .create(new ChannelUID(getThing().getUID(), groupId + "#" + channelId), itemType) .withType(channelTypeUID).withLabel(label).withDescription(description) .withKind(ChannelKind.STATE).build(); updatedThing.withChannel(channel);
but so far didn’t found a way to set attributes like advanced or the pattern etc.
How to achieve that programmatically?