New (static) channels are not shown/added for things already existing [message #1735413] |
Sat, 18 June 2016 13:15  |
Eclipse User |
|
|
|
Hi,
I am currently implementing a binding and adding more channels step by step. Now I observed that after adding new channels (in thing-types.xml), these are not displayed/usable for things which are already known to the system. Only when I remove and re-add a thing, the new channels are available. Is this on purpose or did I break some functionality?
For development this would still be acceptable, but if a binding is extended with a new channel in the next release, doesn't make much sense that users have to re-add all things. Therefore I rather assume that I am missing something in my binding. Any ideas?
|
|
|
|
|
Re: New (static) channels are not shown/added for things already existing [message #1736983 is a reply to message #1735796] |
Mon, 04 July 2016 15:03   |
Eclipse User |
|
|
|
Kai, I already think about this one. Not to find a general solution for the framework but how a binding or binding developer could handle that in the develop phase.
There is already a method to change the thing type.
WDYT, could (for a custom binding) this method work (if I refer to 'thing property' here, I assume something that is allowed to be written by the binding / thing handler and is persistent -- so, not the real thing properties):
* if there is no 'created_version'' property, it is created with the current version of the binding (so, only once)
* if the property is available and does not fit to (is lower then) the current version of the binding, the property is removed and the 'change thing type' method is called (using the same thing type but another UID)
* the thing will be created again and the handler will add created_version with the current one again.
I am only interested if this could be working while the development phase where a thing changes very frequently.
I don't know if a binding should ever remove or add channels. But IMHO it is difficult to decide.
If a handler does not send updates to a previously channel anymore, it is rather useless, but removing it could be lead perhaps to a wired user experience (User: "Hey, where is my channel now??").
Adding channels is perhaps not such a problem, but at least we do not know if a thing has been created by the DSL or something similar...
|
|
|
|
|
Re: New (static) channels are not shown/added for things already existing [message #1739511 is a reply to message #1737621] |
Tue, 02 August 2016 10:55  |
Eclipse User |
|
|
|
Quote:Now I observed that after adding new channels (in thing-types.xml), these are not displayed/usable for things which are already known to the system
It actually just came to my mind that this is not always the case. Afair, for DSL defined Things, all channels from the type are added dynamically at startup, so you should always see the latest changes.
We could possibly change the ManagedThingProvider in a similar way - if we store a Thing without any channels, the channels could be taken from the Thing type at startup. Imho that would be quite useful that way.
If you agree, feel free to enter an issue.
|
|
|
Powered by
FUDForum. Page generated in 0.03313 seconds