Commit Graph

2410 Commits

Author SHA1 Message Date
dependabot[bot]
d994c136db
Bump com.jayway.jsonpath:json-path from 2.8.0 to 2.9.0 in /bom/test (#4059)
Bumps [com.jayway.jsonpath:json-path](https://github.com/jayway/JsonPath) from 2.8.0 to 2.9.0.
- [Release notes](https://github.com/jayway/JsonPath/releases)
- [Changelog](https://github.com/json-path/JsonPath/blob/master/changelog.md)
- [Commits](https://github.com/jayway/JsonPath/compare/json-path-2.8.0...json-path-2.9.0)

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-04 10:18:12 +01:00
Andrew Fiddian-Green
9b5e19e3af
AddonFinderProcess fixes (#4061)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2024-01-31 20:35:23 +01:00
Jacob Laursen
fb7e030ea5
Add command completion (#4063)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2024-01-27 20:59:34 +01:00
Jacob Laursen
5b9fee7d36
[discovery] Fix warnings (#4065)
* Remove unused imports and reference explicit namespaces in Javadoc links
* Fix potential null pointer access
* Remove redundant null checks and dead code
* Suppress deprecation warnings in tests

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2024-01-27 18:14:43 +01:00
lolodomo
a9571228d2
Remove state description when loading an item with a removed pattern (#4068)
* Remove state description when loading an item with a removed pattern

Fix openhab/openhab-webui#2251

Signed-off-by: Laurent Garnier <lg.hc@free.fr>

* Extended integration test testSquareBracketsInFormat

Signed-off-by: Laurent Garnier <lg.hc@free.fr>

---------

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-01-27 18:00:56 +01:00
joerg1985
5f8da67983
Use the ChannelUID to retrieve the Channel from a Thing (#4067)
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
2024-01-27 17:59:22 +01:00
joerg1985
7ea603c24c
Use precompiled regular expressions to validate the segments of a UID (#4064)
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
2024-01-24 21:25:14 +01:00
J-N-K
718839052a
Add console commands to manage add-ons (#4057)
* Add console commands to manage add-ons

Signed-off-by: Jan N. Klug <github@klug.nrw>
2024-01-21 19:13:01 +01:00
Matthew Skinner
4905805ea8
[marketplace] Update CommunityUIWidgetAddonHandler.java to give a more helpful error (#4052)
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>
2024-01-21 08:41:08 +01:00
lolodomo
5c9f192764
Useful logs added in SitemapResource for REST API calls (#4054)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-01-20 22:25:18 +01:00
Wouter Born
6cf048434b
Replace Markdown backticks with JavaDoc code tags (#4023)
* 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>
2024-01-20 09:56:41 +01:00
Wouter Born
c2a0739f1f
Fix several compiler warnings (#4041)
* Fix several compiler warnings

* Add missing null annotations
* Add missing null checks
* Remove use of deprecated SecurityManager
* Remove redundant null checks
* Remove unused variables
* Fix raw use of parameterized class

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-20 09:55:50 +01:00
J-N-K
0b1e1b66ab
Improve RemoteAddonService and fix test (#4049)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2024-01-17 18:31:29 +01:00
J-N-K
d3d0fe3995
Fix config parsing and version handling in RemoteAddonServices (#4043)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2024-01-15 22:42:49 +01:00
J-N-K
c82a9e69dc
Fix logging in ChannelCommandDescriptionProvider (#4040)
The class of the the broken provider should be logged, not the class of the command description.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2024-01-15 22:28:36 +01:00
J-N-K
5cea59bfb1
Improve marketplace add-on handling (#4019)
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>
2024-01-14 21:46:53 +01:00
J-N-K
a6401fa4ac
Fix NPE in UpnpIOServiceImpl (#4038)
Fix #4037

Signed-off-by: Jan N. Klug <github@klug.nrw>
2024-01-14 19:14:00 +01:00
Wouter Born
6495f4e256
Upgrade Jollyday to 0.23.2 (#4033)
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/releases

Fixes #3544

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-14 15:19:15 +01:00
Wouter Born
b77f954848
Improve ThreadPoolManagerTest stability (#4035)
When the CPU load of a system is high these timeouts may not be realistic.

Fixes #3254

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-12 21:42:02 +01:00
Wouter Born
18d9b531ff
Fix wrong class name logged in LocaleServiceImpl (#4034)
Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-12 21:37:48 +01:00
Jacob Laursen
6867f1e956
[discovery] Fix Instant serialization/deserialization regression (#4029)
* 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>
2024-01-12 08:39:11 +01:00
Andrew Fiddian-Green
9cb4b9ee1f
UsbSerialDiscovery service based on Windows registry (#3934)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2024-01-11 20:00:04 +01:00
Jacob Laursen
6b2182dec6
Refactor java.util.Date usages to java.time.Instant (#4026)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2024-01-07 20:51:46 +01:00
GiviMAD
3c61c1d649
[Audio] Add piped audio stream and fix raw PCM streams format (#3960)
* [Audio] Add piped audio stream and fix pcm format usage

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2024-01-07 14:18:50 +01:00
J-N-K
36cafd765f
Fix CurrencyUnit (#4016)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2024-01-05 18:20:43 +01:00
Wouter Born
8e7d5d880c
Fix JavaDoc build (#4018)
Caused by #3957

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-05 18:00:03 +01:00
Kai Kreuzer
c4802e3fb0
Upgrade to JmDNS 3.5.9 (#4015)
For the changelog, see:

https://github.com/jmdns/jmdns/milestone/11?closed=1

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2024-01-05 00:07:41 +01:00
Holger Friedrich
7bac24e58f
IpAddonFinder: Skip installed addons (#4013)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-01-04 22:27:18 +01:00
Wouter Born
c757819a15
Fix JavaDoc issues (#4004)
Fixes various issues including wrong parameter names, references, links and dangling JavaDocs.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-04 00:03:48 +01:00
Wouter Born
6a2777a878
Fix openhab-core-auth-oauth2client feature installation (#4012)
Karaf does not automatically install the feature after `dependency="true"` was added in #3814.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-03 23:40:17 +01:00
Wouter Born
2babea4c9a
Update license headers to 2024 (#4011)
Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-03 21:20:34 +01:00
Wouter Born
6fc7700ea6
Use protected modifier with constructor of abstract classes (#4010)
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>
2024-01-03 16:17:14 +01:00
Wouter Born
81a91ee9ae
Simplify adding elements to Collections (#4006)
* Simplify adding elements to Collections

This optimizes and simplifies the code that adds elements to Collections.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-03 14:51:33 +01:00
Wouter Born
afd1d4726c
Iterate using Map entries (#4003)
* 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>
2024-01-03 14:50:50 +01:00
Wouter Born
106c8b2270
Remove unnecessary semicolons (#4009)
This helps with stopping the proliferation of unnecessary semicolons.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-03 13:47:23 +01:00
Wouter Born
d162b82206
Fix String.format argument mismatches (#4008)
These argument mismatches cause wrong messages being logged and thrown in exceptions.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-03 13:13:53 +01:00
Wouter Born
26a958cd4d
Use static inner classes (#4002)
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>
2024-01-03 12:35:26 +01:00
Wouter Born
10c0cf8211
Simplify assertions (#3996)
* 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>
2024-01-03 12:24:50 +01:00
Wouter Born
564d6e673e
Fix SerialPort.getFlowControlMode() infinite recursion (#4007)
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>
2024-01-03 12:15:41 +01:00
Wouter Born
58a106d36d
Use diamond operator (#4001)
Often the type can be inferred so the diamond operator can be used to simplify the code.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-03 08:22:43 +01:00
Wouter Born
dc5f50db63
Fix assertEquals order (#3995)
The first parameter should be the expected value and the second parameter the actual value.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-02 22:27:53 +01:00
Wouter Born
896b05e177
Replace or remove assert statements (#3994)
Java assertions are disabled by default so in this PR they are replaced/removed where applicable.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-02 22:21:42 +01:00
Mark Herwege
dbc3b19a4f
fix empty rule condition (#3993)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-01-02 19:51:11 +01:00
Wouter Born
041e3b5127
Remove redundant modifiers (#4000)
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>
2024-01-02 19:29:29 +01:00
Wouter Born
4e76d76088
Remove redundant array creation for calling varargs methods (#3997)
These array creations are unnecessary because arrays are created automatically for methods using varargs.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-02 19:01:34 +01:00
Wouter Born
89b67adbd7
Use isEmpty instead of 0 comparisons (#3999)
`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>
2024-01-02 18:47:36 +01:00
J-N-K
a5316f920e
Refactor ThingHandlerService to an OSGi component prototype (#3957)
Also-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com>
Signed-off-by: J-N-K <github@klug.nrw>
2024-01-02 13:09:51 +01:00
openhab-bot
1ddbe3180a
New translations addons.properties (Italian) (#3979) 2024-01-02 10:53:10 +01:00
Kai Kreuzer
30ae005956
Fix build number reporting at startup (#3991)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2024-01-02 10:40:02 +01:00
Wouter Born
7d1dcd7937
Add network-interface context (#3981)
This allows for selecting network interface names in configuration parameters.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-31 22:17:10 +01:00