Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » Changing of channels state and options on build, how?
Changing of channels state and options on build, how? [message #1752569] Wed, 25 January 2017 08:44 Go to next message
Markus Eckhardt is currently offline Markus EckhardtFriend
Messages: 2
Registered: January 2017
Junior Member
hi,

I have a question about the creating/modifying of channels in OH2.
I get from the device a kind of channels. This channels have capabilities like min/max for float or only usable string options.
In ESH this states min/max and options are set in the channels xml file but I cannot use it. This limitations are dynamic and known only after the initialisation of the bridge. How can I modify a channel and add state limits (min/max and options) after the thing is created or in thing/channel creation time?


https://www.eclipse.org/smarthome/documentation/development/bindings/thing-definition.html#state-description

Markus

[Updated on: Wed, 25 January 2017 18:56]

Report message to a moderator

Re: Changing of channels state and options on build, how? [message #1753348 is a reply to message #1752569] Sat, 04 February 2017 10:01 Go to previous messageGo to next message
Markus Rathgeb is currently offline Markus RathgebFriend
Messages: 105
Registered: August 2014
Senior Member

Good question.
The min and max option are currently declared on the channel type and so can't be changed by the channel instance.
You could create a custom channel type (programmatically) all the time you needs other min and max, but I don't think this is the best option.
@kaikreuzer If the min / max is not defined by the type but by a special channel instance, should this channel use a configuration option so a custom UI could react on or should we provide a solution by the framework?
Re: Changing of channels state and options on build, how? [message #1754122 is a reply to message #1753348] Tue, 14 February 2017 15:56 Go to previous message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
This information is indeed on the channel type only. It is retrieved by the ChannelStateDescriptionProvider in getStateDescription(). We could think about introducing a new interface, which bindings could implement, that would then be asked for specific channel information; a bit similar to the ConfigOptionProvider that we put in place for individual config options.
Previous Topic:Dynamic Channel Groups?
Next Topic:ESH TP Version
Goto Forum:
  


Current Time: Tue Dec 10 00:17:17 GMT 2024

Powered by FUDForum. Page generated in 0.03491 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top