|
Re: How to update Channel's min/max [message #1756253 is a reply to message #1756252] |
Tue, 14 March 2017 15:11   |
Eclipse User |
|
|
|
Are you really trying to do that in a binding?
If yes, you'd have the create new channels for min and for max. The updating would be basicly the same as for the original value, with the difference that an update would only be done in case the actual value is is less/more then the min/max saved before.
I would use a persistence service to keep track of min/max values, however that would be outside the binding.
|
|
|
Re: How to update Channel's min/max [message #1756254 is a reply to message #1756253] |
Tue, 14 March 2017 15:16  |
Eclipse User |
|
|
|
Yes, I am trying to do that from a binding.
To put it in perspective: different devices might allow for different ranges in a "Number" channel. When these ranges are only communicated at runtime, I see no other way than updating the Channels min/max.
Quote:If yes, you'd have the create new channels for min and for max.
How would I do that? I cannot find anything about how to programatically create a Channel with custom min/max. I did find this code to create a channel programatically:
Channel channel = ChannelBuilder.create(new ChannelUID("bindingId:type:thingId:1"), "String").build();
but I have no idea how to set the range.
ChannelBuilder also has .withProperties(..) and .withConfiguration(..). Should I use one of the two? What would be the key of the property/config?
Thanks already!
|
|
|
Powered by
FUDForum. Page generated in 0.03415 seconds