Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

RFC: ThingType versioning #4958

Closed
cdjackson opened this issue Jan 20, 2018 · 6 comments
Closed

RFC: ThingType versioning #4958

cdjackson opened this issue Jan 20, 2018 · 6 comments

Comments

@cdjackson
Copy link
Contributor

I would like to propose a mechanism for thing type versioning and updating. At least in ZWave, thing types change occasionally - channels get added or updated, and it would be good to provide the user with a notification that this has happened, and secondly provide a mechanism for updating to the latest definition.

Currently there is no notification, and updating requires deleting the thing and adding it back again. I'm considering adding this into the ZWave binding and since the binding already changes thing types, it would be relatively easy. However, I think it would be better if this were a general feature of the system and not part of any binding.

What I'd propose would work as follows...

  • We add an (optional) <version> tag to the thing type XML. This is a number that is incremented each time the thing type definition is updated.
  • When the thing is instantiated, the version is recorded in the thing.
  • In the UI, it is therefore simple to show the user if the thing has an out of date definition with thingType.version > thing.version.
  • The user can then decide to update to the latest thing definition via an update REST endpoint.
@lolodomo
Copy link
Contributor

This is something we could use each time a developer adds a new channel to a thing type for example ?

@cdjackson
Copy link
Contributor Author

Yes - that's exactly the purpose - if the thing definition changes (new channels, changed channels...) then update the version and the system can tell the user.

I wouldn't personally advocate an automatic update to the latest thing type based on this as it will likely screw peoples systems if channels change, but they should at least be alerted and given the option to use the latest definition.

@MHerbst
Copy link
Contributor

MHerbst commented Jan 21, 2018

Such a mechanism could really be very helpful. E.g. with the Homematic binding it has been necessary to remove things an re-create them again a few times.

@kaikreuzer
Copy link
Contributor

I would claim that #2555 would solve most of the issues without introducing yet another layer of complexity through versioning.

@cdjackson
Copy link
Contributor Author

cdjackson commented Jan 21, 2018 via email

@kaikreuzer
Copy link
Contributor

Could you comment that on #2555 so that discussions happen at the right place?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants