Commit Graph

1991 Commits

Author SHA1 Message Date
J-N-K
3a435ec1e7
Fix marketplace showing incompatible add-ons by default (#4182)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2024-04-14 16:11:38 +02:00
openhab-bot
0eeff02fcc
New translations systemprofiles.properties (Italian) (#4176) 2024-04-13 11:59:29 +02:00
Denis Tarasov
cbb458e0c3
Improve description of hysteresis bounds (#4149)
* doc: improve description of hysteresis bounds

Signed-off-by: Denis Tarasov <dstarasov@skbkontur.ru>
2024-04-07 10:54:42 +02:00
Jacob Laursen
258b0991d8
Provide unit hint for system channel type atmospheric-humidity (#4170)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2024-04-07 10:53:47 +02:00
lolodomo
619762a297
[sitemap] Extend chart periods to cover past and future (#4172)
* [sitemap] Extend chart periods to cover past and future

Closes openhab/openhab-webui#2518

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-04-07 10:51:24 +02:00
Mark Herwege
c2cbefe55c
Unit hint in thing channels (#4079) 2024-04-06 14:21:42 +02:00
lsiepel
f18c50f299
Add abbreviate method (#4164)
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
2024-04-06 14:14:20 +02:00
Holger Friedrich
875ebaaef7
[rest] Fix Java 21 build (#4171)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-04-05 20:40:06 +02:00
lolodomo
dcfadaede6
Move to JUPnP v3.0.1 (#4165)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-04-02 18:21:57 +02:00
Holger Friedrich
9f5a60d6fa
Allow for compiling with Java 21 (#4161)
* Support Java 17 and 21, default compilation to Java 17 class files,
  use maven.compiler.release instead of source and target
* Add profile "j21" to compile to Java 21 class files
* Upgrade SAT to 0.16.0, adapt code which breaks build with new SAT
  checks
* Use model-specific-profile to pin xtend to Java 17

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-04-01 13:46:57 +02:00
Florian Hotze
be9cbf2649
[automation] Avoid memory leak on script loading failure (#4162)
Core part of the fix for https://github.com/openhab/openhab-addons/issues/16462.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-27 22:32:20 +01:00
Florian Hotze
e871dcfa47
[rest] TokenResource: Set SameSite attribute for session id cookie (#4160)
* [rest] TokenResource: Properly set SameSite attribute for session id cookie

Fixes #4159.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-27 22:31:29 +01:00
Florian Hotze
7f47d825a0
[rest] Add caching for add-on resource (#4107)
* [rest] Introduce a CACHE_CONTROL constant
* [rest] Add caching for add-ons endpoint

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-27 19:37:36 +01:00
Arne Seime
bf8b131701
Add REST call to get orphan links (#4115)
* Add REST call to get orphan links

Signed-off-by: Arne Seime <arne.seime@gmail.com>
Co-authored-by: Jan N. Klug <github@klug.nrw>
2024-03-23 23:02:14 +01:00
Mark Herwege
2daf94d7fc
REST response default persistence strategy when no persistence configuration (#4137)
* default persistence strategy in REST response

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-03-23 18:11:34 +01:00
Jacob Laursen
b3047c675a
[oauth] Fix exception wrapping (#4150)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2024-03-23 16:25:44 +01:00
Florian Hotze
c9ee992047
[automation] Allow empty script for script action & script condition (#4148)
* Script action: Allow script to be empty
* Short evaluate to reasonable defaults when script is empty

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-17 20:31:51 +01:00
Holger Friedrich
3850599163
Upgrade to Karaf 4.4.5 and Xtext 2.34 (#4133)
* Upgrade to Karaf 4.4.5 and Xtext 2.34

Upgrade Karaf from 4.4.4 to 4.4.5:
* Sync runtime dependencies with Karaf 4.4.5, most notably:
  * Jetty 9.4.53.v20231009
  * JNA 5.14.0
  * Pax Logging 2.2.6
  * Pax Web 8.0.24
  * ASM 9.6
* Resolve itest runbundles

Upgrade Xtext from 2.32 to 2.34
* Sync depencencies, most notably:
  * Guava 33.0.0
  * classgraph 4.8.165 changing provider to io.github.classgraph
* Migrate old Xtext generator xtext.generator to xtext.xtext.generator
  as xtext.generator has been removed from Xtext, affecting
  org.openhab.core.model.lazygen

* resolve runbundles
* Remove org.openhab.core.model.lazygen
  No longer in use since 2017, see eclipse-archived/smarthome#4122.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-03-17 09:41:15 +01:00
Holger Friedrich
cf7bff88ee
Bump maven-shade-plugin to 3.5.2 (#4152)
Allow for compiling with Java 21

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-03-17 09:24:36 +01:00
Arne Seime
137cc5eb49
[rest] Allow skipping ignored things in inbox (#4108)
* Allow skipping ignored things in inbox

Signed-off-by: Arne Seime <arne.seime@gmail.com>
2024-03-15 15:51:36 +01:00
joerg1985
12a6742189
[rest] special handling for StreamingOutput (#4145)
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
2024-03-12 18:58:31 +01:00
joerg1985
3d83c70184
[rest] refactored the Stream2JSONInputStream to simplify the logic (#4099)
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
2024-03-10 17:24:01 +01:00
Florian Hotze
977fa0329a
[rest] Enable filters for cacheable items list (#4119)
This allows the usage of filters when using `staticDataOnly=true`.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-10 11:41:52 +01:00
Mark Herwege
eeb69197c6
unitSymbol for GroupItem (#4106)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-03-10 10:07:52 +01:00
Florian Hotze
38b73bf989
[auth] Set doctype for auth page (#4129)
Fixes https://github.com/openhab/openhab-webui/issues/2443.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-10 09:59:38 +01:00
joerg1985
094e4a6e04
[rest] stream json without starting a new thread (#4136)
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
2024-03-10 09:46:39 +01:00
openhab-bot
942929973d
New Crowdin updates (#4138)
* New translations addons.properties (French)

* New translations addons.properties (Finnish)

* New translations addons.properties (Hebrew)

* New translations units.properties (Finnish)

* New translations scriptprofile.properties (Hebrew)

* New translations units.properties (Hebrew)

* New translations addons.properties (Polish)

* New translations voice.properties (Polish)

* New translations units.properties (Polish)

* New translations addons.properties (Russian)

* New translations marketplace.properties (Russian)

* New translations units.properties (Russian)

* New translations addons.properties (Ukrainian)

* New translations validation.properties (Danish)

* New translations languagesupport.properties (Portuguese)

* New translations languagesupport.properties (Portuguese, Brazilian)

* New translations addons.properties (Danish)

* New translations scriptprofile.properties (Italian)
2024-03-10 09:41:35 +01:00
Florian Hotze
f4d6089eb0
Call, Contact, Image items: Don't create command descr from state descr (#4097)
* Contact item: Fix command descriptions provided even though commands are not accepted

If a state description is set on a contact item, currently a command description is automatically created as well.
This is wrong as contact items do not accept commands (except refresh) and caused the UI to display a control for the default (list) widget for these contacts.

* Also fix Call and Image items & Allow explicitly setting command description

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-03 13:20:10 +01:00
Holger Friedrich
bca1010c0e
Relax test to accept files with CRLF line endings (#4126)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-03-03 13:05:16 +01:00
Florian Hotze
81805ae6d9
[rest] Set editable for members of an item (#4118)
* [rest] Set editable for members of an item

Required by the UI.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-03 10:14:32 +01:00
Florian Hotze
d26aa080ab
Script profile: Fix deprecation warning (#4110)
Refs #4058.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-02 10:46:28 +01:00
GiviMAD
a94dd51cd3
[net] Expose Jetty EndPoint in http requests (#4092)
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2024-03-02 09:08:48 +01:00
jimtng
97d64a156b
Add numericState and unit to StateDTO (#4123)
* Add numericState to StateDTO

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2024-03-01 18:43:02 +01:00
Gwendal Roulleau
06ee46dff6
Audio parsing : Fix byte / bit confusion (#4116)
Fix two errors for calculating bitrate and duration of sound.
In AudioSinkUtilsImpl : confusion between byte / bite
In AudioWaveUtils : confusion between byte / bite AND with the defintion of framesize (framesize already includes channels number)

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
2024-03-01 18:06:04 +01:00
jimtng
b64e9723a9
Include StartLevelEvent in start level triggers (#4093)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2024-02-18 22:23:27 +01:00
Wouter Born
e628f75d7b
Upgrade jUPnP to 3.0.0 (#4098)
* Upgrades jUPnP from 2.7.1 to 3.0.0.
* Uses a custom OSGiUpnpServiceConfiguration for JDK-8301341 workaround

For release notes, see:

https://github.com/jupnp/jupnp/releases/tag/3.0.0

Signed-off-by: Wouter Born <github@maindrain.net>
2024-02-18 21:27:44 +01:00
Holger Friedrich
40e6202c5f
Minor extension to generic ip discovery (#3943)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-02-14 18:53:41 +01:00
J-N-K
d3fa049532
[persistence] Fix forecast for externally changed data (#4089)
Data added from the REST API is immediately stored in the selected persistence service, bypassing the `PersistenceManager`. Because of that the future values are not correctly "restored".

Signed-off-by: Jan N. Klug <github@klug.nrw>
2024-02-13 21:59:22 +01:00
lolodomo
a906d09b40
[sitemap] Add releaseOnly parameter to Slider sitemap element (#4084)
Related to #3430

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-02-12 20:12:19 +01:00
jimtng
0efaf23d4e
Fix the recursive group membership check (#4088)
Allow a group to be a member of its direct parent and also its parent's ancestors without raising an error.

Looping membership is still detected and prevented as before, thus Stack Overflow is still avoided.

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2024-02-12 17:21:55 +01:00
J-N-K
d806771364
Fix CME in ReadyService (#4086)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2024-02-11 22:44:18 +01:00
Florian Hotze
6be00bd585
Script profile: Separate toHandlerScript for commands and states (#4058)
* Script profile: Separate toHandlerScript for commands and states

This allows much more fine-grained control for the script profile.
E.g. it is now possible to mimic the behaviour of the `system:follow` profile, but apply a script transformation to the forwarded state.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-02-06 21:29:19 +01:00
Wouter Born
f4e83693fb
Simplify Map operations using computeIfAbsent (#4020)
If the specified key is not already associated with a value (or is mapped to null), the given mapping function computes the value.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-02-06 20:34:05 +01:00
Jacob Laursen
823f993f56
Add dimension for emission intensity (#4069)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2024-02-06 20:20:55 +01:00
jimtng
c929e7dfe2
Fix reloading channel config changes in .items file (#4075)
* Apply channel config changes in .items file

Changes in channel config weren't applied because ItemChannelLink.equals() include the link configurations in the comparison. This caused the new link not being found in the set lookup, which leads to erroneously calling notifyListenersAboutAddedElement, when it should've called notifyListenersAboutUpdatedElement instead.

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2024-02-04 11:23:10 +01:00
Wouter Born
85056d9d7b
Some more code cleanup (#4021)
This cleanup includes:

* Use enhanced for loops
* Use text blocks
* Use Objects.equals
* Fix some typos
* Remove redundant variable initialization
* Remove redundant null checks with instanceof
* Remove redundant thrown Exceptions
* Remove redundant empty String concatenation

Signed-off-by: Wouter Born <github@maindrain.net>
2024-02-04 11:17:55 +01:00
M Valla
2cca87a026
[transport.serial] add PORT_DISCONNECTED event (#4056)
Signed-off-by: MV <mvcode00@gmail.com>
2024-02-04 10:29:48 +01:00
J-N-K
fe4cbe546e
Improve YAML model repository (#4024)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2024-02-04 10:29:09 +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
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
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
J-N-K
2abe4e20ed
Respond with 404 if add-on is missing in add-on service (#3989)
* Respond with 404 if add-on is missing in add-on service

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-12-31 14:56:15 +01:00
lolodomo
8b14d56e2e
[sitemap] Fix parsing of button (buttongrid element built with MainUI) (#3980)
Fix openhab/openhab-webui#2242

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-12-30 15:57:52 +01:00
lolodomo
63ae134c33
Consider network settings to avoid creating unexpected JmDNS instances (#3978)
Fix #3976

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-12-30 12:50:27 +01:00
Wouter Born
f376606e92
Simplify boolean expressions (#3971)
Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-28 13:19:01 +01:00
Wouter Born
ba5647b871
More code cleanups (#3975)
While cleaning up the code I found a some more code to cleanup:

* Remove unnecessary boxing
* Use `contains(..)` instead of `indexOf(..) != -1`
* Use `assertInstanceOf` in tests
* Make expensive trace logging conditional
* Remove redundant constructor
* Replace `collect(Collectors.toUnmodifiableList())` with `toList()`
* Replace `filter(..).count() == 0L` with `noneMatch(..)`
* Replace `filter(..).count() > 0` with `anyMatch(..)`

Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-28 13:15:50 +01:00
Wouter Born
0e03943e48
Use String.join instead of Collectors.joining (#3973)
* Use String.join instead of Collectors.joining

String.join results in less code when joining an Iterable or Array.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-28 13:11:14 +01:00
Wouter Born
e958d5b46a
Replace lambdas with method references (#3972)
Method references are more readable because they refer to class names and usually result in less code.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-28 09:55:31 +01:00
J-N-K
bb7a0dad1c
Fix NPE in GroupStateTriggerHandler and GroupCommandTriggerHandler (#3966)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-12-27 23:41:44 +01:00
Holger Friedrich
361273fcb5
IP addon finder: developer docs (#3948)
* IP addon finder: developer docs

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-12-27 20:25:32 +01:00
Andrew Fiddian-Green
a93f3d7d90
Add-on suggestion finder for USB devices (#3922)
Also-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2023-12-27 18:27:40 +01:00
Florian Hotze
f5bd7f94f3
[rest] Add no-cache directive to cached REST responses (#3970)
Fixes https://github.com/openhab/openhab-webui/issues/2102.

This forces the browser to revalidate the cache every time it is accessed to ensure the data is always fresh.
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#directives.

This is approach is also suggested in the mdn web docs, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#up-to-date_contents_always.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-12-27 17:52:49 +01:00
Wouter Born
b08a01c93f
Remove unnecessary parenthesis from lambdas (#3968)
Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-27 17:52:13 +01:00
Wouter Born
ec05a63738
Remove unnecessary boxing (#3969)
Using primitives makes the code faster and consume less memory.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-27 17:50:09 +01:00
J-N-K
ff6b33f3d8
Fix duplicate UIDs in remote add-on services (#3961)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-12-26 23:17:05 +01:00
J-N-K
ad1c37d382
Fix month, week, day not supported (#3964)
Due to the way month, week and day are defined in Indriya their symbol is not added as alias. This is a bug in indriya, but their release cycles are quite long and we should provide a fix for our users.

This should be backported to 4.1.x

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-12-26 22:43:33 +01:00
Wouter Born
11e51abb44
Use OnOffType.from to reduce code (#3954)
You can create an `OnOffType` using a boolean nowadays which reduces the amount of code.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-23 15:33:07 +01:00
Holger Friedrich
bada23fdb8
Minor code cleanup (#3942)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-12-23 12:54:29 +01:00
Holger Friedrich
839ba1ab4c
Apply spotless after release, resolve bundles (#3953)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-12-22 23:14:28 +01:00
openhab-bot
3b279587b1 [unleash-maven-plugin] Preparation for next development cycle. 2023-12-22 11:48:43 +00:00
Kai Kreuzer
074fcdd7ea
Delay the IP scan to make sure that no further candidates are added (#3951)
* Delay the IP scan to make sure that no further candidates are added and do not use a dedicated thread pool

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-12-22 08:49:36 +01:00
openhab-bot
be456792d3
New Crowdin updates (#3950)
* New translations i18n.properties (Romanian)

* New translations network.properties (Romanian)

* New translations i18n.properties (French)

* New translations network.properties (French)

* New translations i18n.properties (Spanish)

* New translations network.properties (Spanish)

* New translations i18n.properties (Czech)

* New translations network.properties (Czech)

* New translations addons.properties (Danish)

* New translations i18n.properties (Danish)

* New translations network.properties (Danish)

* New translations marketplace.properties (Danish)

* New translations units.properties (Danish)

* New translations i18n.properties (German)

* New translations network.properties (German)

* New translations i18n.properties (Greek)

* New translations network.properties (Greek)

* New translations i18n.properties (Finnish)

* New translations network.properties (Finnish)

* New translations i18n.properties (Hebrew)

* New translations network.properties (Hebrew)

* New translations i18n.properties (Hungarian)

* New translations network.properties (Hungarian)

* New translations units.properties (Hungarian)

* New translations i18n.properties (Italian)

* New translations network.properties (Italian)

* New translations units.properties (Italian)

* New translations i18n.properties (Dutch)

* New translations network.properties (Dutch)

* New translations i18n.properties (Norwegian)

* New translations network.properties (Norwegian)

* New translations i18n.properties (Polish)

* New translations network.properties (Polish)

* New translations i18n.properties (Russian)

* New translations network.properties (Russian)

* New translations i18n.properties (Slovenian)

* New translations network.properties (Slovenian)

* New translations i18n.properties (Swedish)

* New translations network.properties (Swedish)

* New translations i18n.properties (Ukrainian)

* New translations network.properties (Ukrainian)

* New translations i18n.properties (Chinese Simplified)

* New translations network.properties (Chinese Simplified)

* New translations i18n.properties (Portuguese, Brazilian)

* New translations network.properties (Portuguese, Brazilian)
2023-12-21 21:51:49 +01:00
Kai Kreuzer
4b310aff30
Catch ISE if config admin is no longer available (#3949) 2023-12-21 21:36:11 +01:00
Andrew Fiddian-Green
924e7b2d6d
Fixes #3946 (#3947)
* Fixes #3946

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2023-12-21 18:23:43 +01:00
Kai Kreuzer
369bd228e7
Move addons.xml to runtime folder (#3944)
* Move addons.xml to runtime folder

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-12-20 23:53:10 +01:00
Kai Kreuzer
dceec22a35
Improve HTTP 404 handling and logging (#3940) 2023-12-20 12:35:25 +01:00
Jacob Laursen
e8641efd5b
Provide I18N properties for Unit Settings (#3941) 2023-12-20 12:34:58 +01:00
Holger Friedrich
5e94d8350b
Additional logging AddonInfo addons.xml (#3928)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-12-20 11:19:35 +01:00
lolodomo
d7486a985e
Sitemap generator: fix button parsing for Buttongrid (#3938)
Fix #3937

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-12-20 09:46:41 +01:00
Wouter Born
81f14c9df1
Upgrade logback-classic to 1.3.14 (#3935) 2023-12-19 23:26:22 +01:00
Kai Kreuzer
04cd8408de
Don't log errors on NotFoundExceptions in Jetty (#3931) 2023-12-19 21:16:05 +01:00
openhab-bot
cb1b355869
New Crowdin updates (#3929)
* New translations addons.properties (Hungarian)

* New translations addons.properties (Italian)

* New translations languagesupport.properties (Portuguese)

* New translations languagesupport.properties (Portuguese, Brazilian)

* New translations addons.properties (Hebrew)
2023-12-19 21:05:30 +01:00
Andrew Fiddian-Green
3362bfbea0
Upnp add M-SEARCH with search target ST: upnp:rootdevice header (#3933)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2023-12-19 20:40:20 +01:00
Holger Friedrich
24b1784d44
Reduce SAT warnings (#3932)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-12-19 20:37:57 +01:00
Holger Friedrich
8bed621c8c
Service to suggest addons via generic IP scan (#3920)
* Service to suggest addons via generic IP scan

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-12-17 13:12:55 +01:00
openhab-bot
2c9312e55c
New Crowdin updates (#3919)
* New translations addons.properties (Danish)

* New translations addons.properties (Italian)

* New translations addons.properties (French)
2023-12-16 17:23:47 +01:00
Holger Friedrich
fe5f130ca7
minor doc update to fix javadoc build (#3926)
* minor doc update to fix javadoc build

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Co-authored-by: Andrew Fiddian-Green <software@whitebear.ch>
2023-12-16 17:22:40 +01:00
GiviMAD
8cc8d8668a
[Voice] Fix match question and allow force command (#3925)
* [voice] Fix match question and allow force command

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-12-16 12:29:45 +01:00
Mark Herwege
d3ebc824b3
jar file add-on logger name (#3921)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-12-16 11:26:30 +01:00
GiviMAD
4ace1557f4
[voice] Add interface to represent a remote keyword spotter (#3564)
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-12-16 11:22:38 +01:00
J-N-K
c8a6cf2603
[UoM] Add currency handling (#3503)
* Add currency as unit

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-12-16 11:18:25 +01:00
Mark Herwege
fe242f8ab9
Modified finder discovery schema to make future finders easier to create (#3924)
* change discovery method schema

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-12-16 11:08:09 +01:00
Holger Friedrich
4e634c6b55
Service to suggest addons based on running processes (#3904)
* Service to suggest addons based on running processes

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-12-16 10:52:41 +01:00
lolodomo
4b92db3775
Add a log when loading a YAML file (#3916)
For consistency with other model files loading.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-12-13 08:26:29 +01:00
Andrew Fiddian-Green
8082daa290
UPnpAddonFinder M-SEARCH ST: ssdp:all (#3918)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2023-12-12 18:29:27 +01:00
Mark Herwege
5ffeb1fc72
i8n suggestion finders config (#3913)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-12-11 21:58:18 +01:00
Andrew Fiddian-Green
be70a13afe
Handle ISE when shutting down (#3910)
* Suppress logging when shutting down
* Cancel scheduled tasks on shutdown

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2023-12-10 22:45:12 +01:00
lolodomo
070de55b27
Add a YAML file provider for semantic tags (#3659)
* Add a YAML file provider for semantic tags

Files in folder conf/tags are loaded by this provider.

Related to #3619

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-12-10 11:26:03 +01:00
lolodomo
152ffe3fbb
Fix handling of mDNS instances when an IP address changed (#3906)
Fix openhab/openhab-addons#16023

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-12-09 21:56:56 +01:00
Mark Herwege
708a954081
Fix addon name localisation before installation (#3908)
* fix addon name and description

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-12-09 20:29:24 +01:00
Andrew Fiddian-Green
bb30eab3b9
[addon] fix #2204 (#3905)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2023-12-09 12:19:51 +01:00
Andrew Fiddian-Green
62a50a409a
Service to find suggested addons to install (#3806)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Co-authored-by: Mark Herwege <mark.herwege@telenet.be>
2023-12-07 17:32:33 +01:00
Andrew Fiddian-Green
de9912d06b
AddonInfoAddonsXmlProvider check for missing folder (#3903)
* [AddonInfoAddonsXmlProvider] fix issue #3901

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2023-12-07 14:30:10 +01:00
Jared
44b92dbc59
add support for passing extra fields to oauth token request (#3881)
allows using oauth client for authentication with velux API https://github.com/nougad/velux-cli/blob/master/velux-protocol.md#initial-login

Signed-off-by: Jared Lyon <lyonj3@gmail.com>
2023-12-06 07:32:47 +01:00
GiviMAD
075bcea8c2
[voice] Support custom rules on item metadata (#3897)
* [voice] Support custom rules on item metadata
* fix isTemplate functionality and test
* fix filter location based for non labeled rules

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-12-06 07:18:44 +01:00
lolodomo
76b10ac1c1
[Sitemap] Change syntax for Buttongrid sitemap element (#3898)
Follow-up #3810

Location in the grid is now defined by a row number and a column number.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-12-05 21:50:58 +01:00