Installing from marketplace gives an Error that is not very helpful.
Couldn’t find the widget in the add-on entry
The cause was missing ```yaml code fence when a normal code fence was used. This used to work in the past so a number of widgets are done this way and will not install. Suggest a more useful message to help guide widget devs.
Signed-off-by: Matthew Skinner <matt@pcmus.com>
* Replace Markdown backticks with JavaDoc code tags
The proper way to format code with JavaDoc is using code tags and not Markdown backticks.
Signed-off-by: Wouter Born <github@maindrain.net>
It has been reported several times that add-ons were not properly installed / missing after an upgrade or the installation of incompatible add-ons resulted in broken installations.
After an upgrade (or clean cache) the `AddonHandler`s try to re-install the add-ons from the download cache (`<userdata>/marketplace`). This happens without checking compatibility. This was needed before OH4, because the cache was the only source providing information about installed add-ons. This is now different, since we store the add-on information in a JSON database, so the UIDs of the add-ons are known.
This PR changes improves the add-on services. It now
1. Reads the information about the installed add-ons from the database and sets the installation status based on information from the handlers.
2. Removes all add-ons that are not installed from the JSON database and remembers their UIDs.
3. Refreshes the remote add-on list (including check for compatibility if not disabled).
4. Tries installation of the add-ons remembered in step 2. Since incompatible add-ons are missing in the add-on list, their installation fails and a warning is logged.
This PR is has two corresponding PR in openhab-distro and openhab-linuxpkg to ensure that the upgrade script and `openhab-cli` also clear the marketplace cache.
Signed-off-by: Jan N. Klug <github@klug.nrw>
Upgrades Jollyday 0.5.10 (de.jollyday) to 0.23.2 of a more actively maintained fork (de.focus-shift).
* This adds many missing holidays.
* Also removes the workaround for the Danish Great Prayer Day introduced by #3573.
For release notes, see:
https://github.com/focus-shift/jollyday/releasesFixes#3544
Signed-off-by: Wouter Born <github@maindrain.net>
* Fix Instant serialization/deserialization regression
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Consolidate serialization and deserialization in same type adapter
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Simplify deserializer
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
---------
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Abstract classes should not have public constructors.
Constructors of abstract classes can only be called in constructors of their subclasses.
So there is no point in making them public.
The protected modifier should be enough.
Signed-off-by: Wouter Born <github@maindrain.net>
* Simplify adding elements to Collections
This optimizes and simplifies the code that adds elements to Collections.
Signed-off-by: Wouter Born <github@maindrain.net>
* Iterate using Map entries
Iteration using Map entries is preferred because it is more efficient and helps preventing NPEs.
Signed-off-by: Wouter Born <github@maindrain.net>
A static inner class does not keep an implicit reference to its enclosing instance.
This prevents a common cause of memory leaks and uses less memory per instance of the class.
Signed-off-by: Wouter Born <github@maindrain.net>
* Simplify assertions
Using the appropriate assertion methods results in less and easier to read code as well as better error messages when assertions fail.
Signed-off-by: Wouter Born <github@maindrain.net>
An infinite recursion would occur when calling this method.
I did not find any add-ons using this method but that could be due to this bug.
Signed-off-by: Wouter Born <github@maindrain.net>
Removes redundant modifiers from the code.
These modifiers redeclare the default modifiers that apply to interfaces, enums etc.
Signed-off-by: Wouter Born <github@maindrain.net>
These array creations are unnecessary because arrays are created automatically for methods using varargs.
Signed-off-by: Wouter Born <github@maindrain.net>
`isEmpty()` expresses the intent more clearly and is therefore preferred.
Counting the number of elements can also be an expensive operation e.g. when using linked lists.
Signed-off-by: Wouter Born <github@maindrain.net>