Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important: This larger PR is still work in progress. The PR is meant as tech preview to try out bundles and improve the possible rough edges asap. While the technical side in this PR is almost done, the user facing UI needs to be figured out still.
Features:
DDF Bundles
A bundle is just a single file with
.ddf
extension which contains the raw DDF JSON and all JS and JSON files it references. E.g. the files ingeneric/items
andgeneric/subdevices
etc.Unbreakable
Each bundle has a unique SHA-256 hash over its content. The hash is signed by well known public keys, currently one for stable and one for beta bundles. These signatures are also part of the bundle.
And that makes bundles "unbreakable", for example changing an item in
generic/items
won't accidentally alter a stable bundle. But create a new one, which is only signed as beta — with the former stable bundle still existing.DDF load policy
Each device has two new top level API facing items
attr/ddf_policy
andattr/ddf_hash
. The policy specifies which bundles (or raw JSON DDFs) are loaded for a device. Theattr/ddf_hash
in combination with thepin
policy can be used to pin a specific bundle to a device.<sha256-hash>
.To not cause havoc in the developer community, the raw JSON files, e.g.
devices/
directory, will be still part of deCONZ and are usable as they are used to be.In the same spirit there are two new directories, a deCONZ packaged
bundles/
and a $USER locationbundles/
from which.ddf
files are loaded.Performance
Loading bundles is ca. twice as fast as loading all raw JSON files. Further new in this PR only those DDFs are loaded into memory for devices which are actually present in the setup. The code was designed to crunch through thousands of DDFs easily since at some point we may end up with 3K to 5K bundles in total. We don't need to load thousands DDFs if a setup only has 30 distinct device types.