Commit Graph

2076 Commits

Author SHA1 Message Date
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
Andrew Fiddian-Green
cc9b70516a
AddonInfo extensions (#3865)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2023-12-05 16:49:31 +01:00
Jacob Laursen
aa305d90d0
Fix AutoUpdatePolicy for channel (#3888)
* Fix AutoUpdatePolicy for channel

Fixes #3887

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Simplify setting of auto update policy

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

---------

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2023-12-04 10:56:33 +01:00
Holger Friedrich
9a9726b8fe
[ColorUtil] Extend rgbToHsb(PercentType[]) for RGBW (#3882)
* [ColorUtil] Extend rgbToHsb(PercentType[]) for RGBW

rgbToHsb(PercentType) supports arrays of size 4 (RGBW) in addition to and arrays of size 3 (RGB).

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-12-03 20:14:35 +01:00
J-N-K
7186bf85ff
Add time-series support for websockets (#3889)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-12-03 20:11:56 +01:00
joerg1985
32237a9bdc
Do not leak running pools from the internal collection (#3885)
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
2023-11-24 22:24:37 +01:00
lolodomo
f71ebfb83c
Extend support to ISO8601 format for sitemap chart period parameter (#3863)
* Extend support to ISO8601 format for sitemap chart period parameter

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-11-24 16:53:10 +01:00
joerg1985
ae117f6317
Use a single thread to watch all event executors (#3884)
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
2023-11-24 16:52:07 +01:00
joerg1985
bdb1e55b58
Use a scheduled thread pool in JsonStorage + Bugfixes (#3874)
* Use a scheduled thread pool in JsonStorage to avoid one thread per instance
* Removed an incorrect conversion between millis and nanos

Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
2023-11-22 22:43:44 +01:00
Holger Friedrich
3e3afd8cdc
[DSL] Expose ColorUtil methods to DSL rules (#3879)
New functions for RGBW introduced in #3849.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-11-22 21:36:39 +01:00
J-N-K
8a6e7432cd
Add log websocket (#3859)
This adds a websocket connection for receiving logs.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-11-22 21:35:35 +01:00
Wouter Born
7af02598ef
Small code cleanup (#3873)
* Removes hyphens from JavaDoc parameters
* Fixes a few 'exists' grammar mistakes

Signed-off-by: Wouter Born <github@maindrain.net>
2023-11-15 16:47:58 +01:00
Holger Friedrich
9ad2fef549
Fix javadoc warnings (#3870)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-11-15 09:21:07 +01:00
Holger Friedrich
47cc6db982
Fix javadoc warnings in directory org.openhab.core (#3867)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-11-12 11:38:36 +01:00
Marco Müller
237f2ebb56
[core] Add conversion for HSB to RGBW and back (#3849)
* Add conversion for HSB to RGBW and back
for KNX DPT251.600 to use all 4 colors.

With the new feature, the HSBType can converted into RGBW, and also back
to HSB.

Due to the conversion, some accuracy is lost, but the result is
approximately correct.

Signed-off-by: Marco Müller <marco@ms-mueller.ch>
2023-11-12 11:23:44 +01:00
J-N-K
cdbca4dd0a
Allow sending TimeSeries for items (#3597)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-11-07 20:08:41 -08:00
maniac103
fb6f1923e8
[sitemap] Provide information about widget label source to clients (#3804)
* [sitemap] Provide information about widget label source to clients

The label can be populated from a label specified on the respective
sitemap widget, or (if no label was specified) from the label of the
backing item. Allow clients to differentiate between both cases.

Related to openhab/openhab-webui#2065

Signed-off-by: Danny Baumann <dannybaumann@web.de>
2023-11-06 21:40:36 -08:00
jimtng
99bb994b36
Suppress SseItemStates warnings during startup (#3774)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2023-11-06 21:36:21 -08:00
GiviMAD
ade531288f
[voice] Support item descriptions in built-in interpreter. (#3853)
* [voice] Support item descriptions in built-in interpreter

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-11-06 21:34:00 -08:00
Gwendal Roulleau
26283dab75
[webaudio] Allow stopping play (#3766)
Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
Co-authored-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
2023-11-01 08:50:01 +01:00
J-N-K
7b0f77bac3
Fix thing upgrades for bridges (#3858)
Bridges could not be updated because the updated bridge was a `ThingImpl` instead of a `BridgeImpl`. Also the copy-creator in the `BridgeBuilder` was missing. This should also be cherry-picked to 4.0.x.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-10-30 18:31:32 +01:00
Mark Herwege
d75d6dffce
Fix UI defined sitemaps (#3850)
* fix UI defined sitemaps
* allow AND conditions
* label not required

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-10-26 23:30:17 +02:00
Wouter Born
f2c20af944
Improve FolderObserver ignored paths handling (#3856)
The FolderObserver needs to make sure that paths are properly handled for any parsers that are added at any moment by other threads during activation.

Fixes #3784
Fixes #3793

Signed-off-by: Wouter Born <github@maindrain.net>
2023-10-21 09:23:07 +02:00
Kai Kreuzer
14f8490d1c
Address warnings in StringUtils class (#3845)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-10-15 22:01:07 +02:00
lolodomo
7281dca286
[Sitemap] Add optional conditional rules for icon (#3820)
This allows dynamic icons based on items states even with non OH icon sources.
This also allows overwritting the default handling with state done by the icon servlet.

Example: icon=[item1>0=temperature,==0=material:settings,f7:house]

Related to openhab/openhab-webui#1938

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-10-15 22:00:35 +02:00
lsiepel
4001161810
Add string utils to core (#3738)
* Add utils to core

Signed-off-by: lsiepel <leosiepel@gmail.com>
2023-10-15 20:35:15 +02:00
J-N-K
ae85096e53
Improve code in QuantityType (#3842)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-10-10 21:49:41 +02:00
jimtng
e9d969c31d
Fix QuantityType UNIT_PATTERN regex (#3841)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2023-10-10 10:08:45 +02:00
Wouter Born
783c57cbb9
Use 'uid' instead of 'UID' as method parameters (#3840)
Using 'UID' is confusing as method parameter because it can be mistaken for some kind of constant while reading code.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-10-09 21:39:47 +02:00
Wouter Born
e8e1c9fe73
Simplify code that creates List, Map and Set objects (#3836)
Simplifies the code by using List.of, List.copyOf etc. where possible which results in less code and imports.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-10-09 18:00:00 +02:00
jimtng
304453ec58
Make DecimalType, QuantityType, PercentType accept lowercased exponent notation (#3834)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2023-10-09 10:59:25 +02:00
Wouter Born
09b3160a55
Simplify code using Stream.toList (#3831)
Stream.toList was introduced in Java 16 and creates an unmodifiable List so it can be used to simplify code whenever the List is not expected to be modified.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-10-09 09:20:08 +02:00
Florian Hotze
2794c973d3
[rest] Add caching for UoM info (#3838)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-10-09 09:18:45 +02:00
Florian Hotze
176e23f296
Fixes source filter not working for GenericEventTrigger (#3837)
While reviewing https://github.com/openhab/openhab-js/pull/300,
I noticed that filtering by source `org.openhab.core.expire` was not possible.

This was because the specified source was checked against the event topic, which makes no sense at all given that different schemes.
Source filtering is done inside the `apply` method.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-10-08 19:43:08 +02:00
lolodomo
e5518b9322
[Sitemap] Add support for multiple AND conditions (#3819)
Concerns labelcolor, valuecolor and visibility

Also fix wrong positions of ")" in Sitemap.xtext

Closes #3058

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-10-08 09:48:58 +02:00
jimtng
0d355fbbc7
Make QuantityType.toUnitRelative accept a String (#3802)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2023-10-06 20:42:50 +02:00
Wouter Born
93d80e36b9
Remove unused javax.inject annotations (#3827)
AFAIK these annotations are not used when using declarative services.

I stubled upon these annotations when feature validation failed while creating #3817.
Xtext now uses Guice 7 which is using jakarta.inject imports.

Only si.uom:si-units:2.1 still imports javax.inject but it will also switch to jakarta.inject when 2.2 gets released.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-10-04 22:10:53 +02:00
Wouter Born
012d7a034f
FolderObserver improvements (#3821)
* Mark extensions as ready in addModelsToRepo only if parser was availabile
* Store valid extensions using Set instead of List
* Use java.nio where possible
* Add more debug logging
* Cleanup and simplify code

Signed-off-by: Wouter Born <github@maindrain.net>
2023-10-03 13:19:26 +02:00
openhab-bot
dda021ae07
New Crowdin updates (#3807)
* New translations addons.properties (Russian)
* New translations automation.properties (Hebrew)
* New translations languagesupport.properties (Portuguese)
* New translations languagesupport.properties (Portuguese, Brazilian)
* New translations scriptprofile.properties (Finnish)
* New translations voice.properties (Finnish)
* New translations voice.properties (Hebrew)
2023-10-02 10:30:39 +02:00
lolodomo
f7d176570c
[Sitemap] Accept an optional icon for each value/label mapping (#3809)
* [Sitemap] Accept an optional icon for each value/label mapping

When set by the user, the icon can be used by UIs for switch element with mappings to render a button with the icon rather than the label.

Related to #3441

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-10-02 09:36:23 +02:00
Mark Herwege
3eef2872f5
fix trailing space in state string (#3812)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-10-01 21:47:25 +02:00
lolodomo
366bffa406
[Sitemap] Introduce "Buttongrid" as new sitemap element (#3810)
Related to #3441

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-10-01 21:36:31 +02:00
lolodomo
369a49aab1
[sitemap/MainUI] Fix a typo in buildWidget (#3811)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-10-01 16:38:38 +02:00
Wouter Born
d4a433a4ce
Upgrade to Karaf 4.4.4 (#3814)
* Sync runtime dependencies with Karaf 4.4.4, most notably:
  * Jetty 9.4.52.v20230823
  * JNA 5.13.0
  * SLF4J 2.0.6
  * Pax Logging 2.2.3
  * Pax Web 8.0.22
* Resolve itest runbundles
* Use new Pax Web features to simplify dependency management
* Add specs features because Pax Web now depends on "asm"

Signed-off-by: Wouter Born <github@maindrain.net>
2023-09-29 20:23:31 +02:00
J-N-K
af4fce1e4f
Fix CommunicationManager command handling (#3714)
* Fix CommunicationManager

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-09-13 22:27:12 +02:00
GiviMAD
d87ef1f645
[voice] Add dialog group and location (#3798)
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-09-13 21:09:13 +02:00
Wouter Born
f6435ec132
Fix countries and connection AddonInfo issues (#3797)
Fixes the following:

* connection and countries details missing for some AddonServices
* missing connection getter on AddonInfo
* countries lists has empty String when when countries info is missing

Related to #3795

Signed-off-by: Wouter Born <github@maindrain.net>
2023-09-09 12:15:03 +02:00
J-N-K
daeb367155
Add uptime to /systeminfo REST endpoint (#3796)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-09-09 10:57:07 +02:00
Mark Herwege
2b8475253f
Adjust QuantityType calculations for temperatures (#3792)
* fix quantity calculations
* remove temperature offsetProfile workaround

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-09-08 18:02:34 +02:00
GiviMAD
4364e3b354
[voice] Reduce collisions on exact match and use item synonyms (#3698)
* [voice] Reduce collisions on exact match and use item synonyms

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-09-08 16:32:43 +02:00
lolodomo
1c8096b4eb
[DSL] Expose ColorUtil methods to DSL rules (#3749)
Fix #3743

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-09-02 19:14:59 +02:00
Wouter Born
c39d15ade6
Cleanup code (#3787)
This code cleanup fixes various warnings in Eclipse.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-08-30 22:50:17 +02:00
Gwendal Roulleau
3ddbdb25ed
[cache] Fix concurrent use of a cache entry (#3785)
Closes #3507
Fix some rare case where the concurrent readings of a cache entry can fail.

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
2023-08-30 14:23:35 +02:00
Wouter Born
e765af06cb
Upgrade Maven and plug-ins (#3788)
* Use Maven 3.9.4 with GitHub Actions CI
* Upgrade Maven plug-ins

Signed-off-by: Wouter Born <github@maindrain.net>
2023-08-30 13:29:34 +02:00
Wouter Born
f8b52ea3f6
Use JUnit TempDir which automatically removes temp dirs (#3786) 2023-08-28 22:30:56 +02:00
dependabot[bot]
a0eeed9292
Bump org.apache.ivy:ivy in /bundles/org.openhab.core.semantics (#3773)
Bumps org.apache.ivy:ivy from 2.5.1 to 2.5.2.

---
updated-dependencies:
- dependency-name: org.apache.ivy:ivy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-28 09:41:50 +02:00
J-N-K
b426cccf9c
Fix GenericThingProvider (#3779)
When things from multiple handler factories are provisioned from the same file the internal thing map was not properly updated.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-08-28 09:26:52 +02:00
Wouter Born
9cc7b58ac0
Fix linuxsysfs itest failing when serial device is connected (#3782)
This fixes that some linuxsysfs tests always fail on Linux whenever a real serial device is connected.
Due to the changes in #3290 the tests would also scan the actual devices causing tests to fail due to unexpected results.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-08-27 11:16:04 +02:00
Wouter Born
5daf4ff076
Fix SAT and null analysis issues (#3781)
Signed-off-by: Wouter Born <github@maindrain.net>
2023-08-27 11:15:15 +02:00
Mark Herwege
096d11bf3f
Fix sitemap visibility rule with blanks (#3769)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-08-26 15:10:10 +02:00
Holger Friedrich
ce5cef959b
Migrate to java.nio.file.createTempFile (#3767)
Use function from nio package as it uses more restrictive file permissions.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-08-26 15:08:03 +02:00
Wouter Born
d909543415
Upgrade org.bouncycastle:bcpkix-jdk15on (#3765) 2023-08-19 10:54:57 +02:00
J-N-K
04eb32185c
Bump UoM libraries to 2.2 (#3758)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-08-18 21:38:43 +02:00
lolodomo
5f8658d0ae
[REST] Check a label is provided when creating a new semantic tag (#3734)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-08-16 17:48:09 +02:00
Wouter Born
aef57edd73
Use workaround to fix high CPU usage by LinkedTransferQueue (#3756)
This is a workaround for JDK-8301341 by using the Java 11 LinkedTransferQueue with the QueueingThreadPoolExecutor in the Core and jUPnP.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-08-14 10:37:20 +02:00
lolodomo
c12067a63b
[sitemap] Add new "staticIcon" parameter (#3735)
When set, the UI should not provide the item state when requestiong the
OH icon and should not request again the icon when the item state is
updated.

Related to openhab/openhab-android#3404

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-08-13 19:36:41 +02:00
J-N-K
3af2e30098
Fix logging in AbstractProvider implementations (#3751)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-08-13 18:20:02 +02:00
J-N-K
da73b5770c
Fix CME in RuleEngineImpl (#3754)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-08-13 18:18:45 +02:00
J-N-K
caf13da88a
Fix StackOverflowError in SemanticsMetadataProvider (#3748)
In case of cyclic/recursive membership of groups (i.e. a group has itself or a child as parent) the recursive processing of the items leads to an `StackOverflowError` (reported in the forum and the german Facebook group). Also this is clearly a configuration error it should not result in the bundle not starting.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-08-12 11:49:12 +02:00
Wouter Born
04105c1b1a
Link to Java 17 documentation (#3750)
This prevents issues because older documentation may not apply to Java 17.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-08-12 10:19:48 +02:00
J-N-K
409198cd8c
Move factory interface to public package (#3742)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-08-11 17:47:44 +02:00
openhab-bot
a690aeba3d
New Crowdin updates (#3744)
* New translations voice.properties (Hungarian)

* New translations automation.properties (Hungarian)
2023-08-11 14:08:26 +02:00
openhab-bot
b3cc326217
New Crowdin updates (#3739)
* New translations automation.properties (Italian)

* New translations LanguageSupport.properties (Portuguese, Brazilian)
2023-08-03 14:08:47 +02:00
Florian Hotze
c4fb71fcc6
[automation] Update texts for rule-based actions (#3733)
Core part of https://github.com/openhab/openhab-webui/issues/1921.

With UI-support for scenes & scripts, the texts (labels, descriptions etc.) for rule-based actions should be updated to mention scenes & scripts as well.
This improves the UI experience.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-07-30 20:26:51 +02:00
Florian Hotze
f5a0b37b3d
[persistence] Handle null value for relative & inverted props of filters (#3727)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-07-25 21:07:24 +02:00
Florian Hotze
e1741cf61d
[rest] Add caching for TagResource & De-duplicate code for caching (#3729)
* [rest] Add caching for TagResource
* [core] Add & use RegistryChangedRunnableListener class

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-07-25 20:59:39 +02:00
J-N-K
79fd459f59
Fix limitToOptions in script profile (#3730)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-25 09:16:07 +02:00
Kai Kreuzer
5692232e2b Apply spotless
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-07-24 01:11:37 +02:00
openhab-bot
fd93f0a766 [unleash-maven-plugin] Preparation for next development cycle. 2023-07-23 17:14:35 +00:00
J-N-K
546e34252f
Fix system started DSL rules (#3725)
* Fix system started DSL rules

Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-07-23 10:21:37 +02:00
GiviMAD
559ab9136f
[Auth Filter] Fix implicit user role for websocket connections (#3724)
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-07-22 22:53:19 +02:00
Flole998
5449c476e0
Provide correct version information for XChart in NOTICE (#3721)
Signed-off-by: Flole <flole@flole.de>
2023-07-21 22:07:20 +02:00
J-N-K
573c94b560
Fix MQTT crashes when subscriber throws exception (#3719)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-21 17:37:57 +02:00
Kai Kreuzer
7a87001f98
Revert "Upgrade XChart to 3.8.4 (#3291)" (#3720)
This reverts commit c2e81a13fd.
2023-07-21 17:21:14 +02:00
J-N-K
b8ae55c3f5
Fix rule startlevel trigger executes during initialization (#3717)
* Fix rule startlevel trigger executes during initialization

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-21 14:18:28 +02:00
Florian Hotze
72ec0f3517
[rest] Add missing fields to /rest/items?staticDataOnly=true resource (#3712)
Fixes #https://github.com/openhab/openhab-webui/issues/1958.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-07-21 13:35:38 +02:00
Florian Hotze
62a83557ae
[persistence] Handle null value for unit field of filters (#3716)
Setting up a treshold filter with the UI, it did not work because the unit field was blank.
I got an NPE from PersistenceTresholdFilter, and the PersistenceIncludeFilter would also throw a NPE in that case.
For PersistenceTimeFilter, defaulting to "s" is just cosmetic.

Picks-up PR #3681 and should be merged for the 4.0 release, because the UI does not prevent the unit field from being null.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-07-20 17:17:53 +02:00
J-N-K
5a00bfdc41
Align system-channel-types for electricity (#3707)
* Align system-channel-types for electricity

These are only used by one binding at the moment and it's very inconsistent to have power, voltage and current with the "electric" prefix and energy with "electrical".

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-18 09:05:42 +02:00
Wouter Born
3396ff7758
Use Eclipse formatter 4.25 with Spotless (#3710)
Fixes #3515

Signed-off-by: Wouter Born <github@maindrain.net>
2023-07-18 09:03:16 +02:00
openhab-bot
2ee85a75f5
New translations voice.properties (French) (#3709) 2023-07-17 17:58:47 +02:00
lolodomo
f71137331f
[Sitemap UI] Do not break format defined in label with extra spaces (#3708)
Fix openhab/openhab-webui#1953

Fix a regression introduced by PR #3644

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-07-17 17:58:01 +02:00
J-N-K
66dec25571
Keep channel properties in upgrades (#3612)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-16 10:24:21 +02:00
J-N-K
9ba8e71c54
Add unit "calorie" (#3684)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-15 22:18:27 +02:00
openhab-bot
7b7ccba5bb
New translations voice.properties (Italian) (#3703) 2023-07-15 22:17:15 +02:00
J-N-K
35ca7a9a94
Fix NPE in PersistenceManager (#3704)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-15 22:16:32 +02:00
Gwendal Roulleau
07e88234c6
[voice] Add length limit to TTS handled by cache (#3699)
* [voice] Add length limit to TTS handled by cache

We can safely assume that long TTS are generated for report (meteo, chatGPT ?), probably not meant to be repeated, and so not cached.

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
2023-07-15 09:47:59 +02:00
J-N-K
141b7b637a
Increase large event queue warn limit (#3702)
On larger installations with 1000+ items the limit of 1000 elements in the queue is exceeded easily. Since no events are lost (they just take longer to be processed), the limit that needs to be exceeded before a warning is issued should be increased.

See reports on the forum.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-14 21:47:14 +02:00
Mark Herwege
f0c00959aa
[rest] add unit to item response (#3654)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-07-14 20:01:22 +02:00
openhab-bot
fb4f45e3e2
New Crowdin updates (#3653)
* New translations scriptprofile.properties (Hungarian)

* New translations validation.properties (Hungarian)

* New translations automation.properties (Hungarian)

* New translations lsp.properties (German)

* New translations persistence.properties (German)
2023-07-11 18:47:44 +02:00
lolodomo
f0adf76719
HTTP audio servlet: check end of play every 2 seconds (#3695)
Instead of 5s before.
It helps triggering the end of playback earlier for audio sinks in asynchronous mode.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-07-11 18:46:01 +02:00
lolodomo
591b16ff35
Avoid null hash warning in WatchServiceImpl when possible (#3691)
Fix #3680

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-07-07 20:26:12 +02:00
J-N-K
abcfe54678
Fix marketplace add-ons missing config description URI (#3688)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-06 08:26:33 +02:00
J-N-K
6a0b268c3e
Fix wrong ready marker in ScriptEngineFactoryBundleTracker (#3683)
* Fix wrong ready marker in ScriptEngineFactoryBundleTracker
* fix ready marker handling

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-06 08:25:13 +02:00
lolodomo
e9719eb577
Make firmwareStatus field not final in DTO object (#3687)
Fix #3679

If not, calls of method limitToFields by PR #3335 fails when the list of
fields does not contain firmwareStatus.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-07-05 21:02:24 +02:00
lolodomo
b2934ad044
Avoid warning log introduced by PR #3644 (#3686)
Fix openhab/openhab-webui#1951

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-07-05 20:15:10 +02:00
J-N-K
4be95788f1
Remove error logging from PersistenceIncludeFilter (#3682)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-04 07:34:27 +02:00
J-N-K
a656073352
Improve performance for state update handling (#3635)
* Improve threading in EventHandler
* refactor pagechangelistener to event
* One executor per subscriber type, not per subscriber

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-02 12:12:53 +02:00
GiviMAD
6b914162bf
[voice] Add console commands for register/unregister dialogs and list them (#3459)
* [voice] Add voice commands for register/unregister dialogs and list dialogs and dialog registrations

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-07-02 11:27:10 +02:00
Gwendal Roulleau
3ec1457583
[audio] Improve audio duration computation (#3675)
Allows the use of a Sizeable interface (for AudioStream that we know the length of, but we cannot clone). We can then improve the duration detection, for example for the pulseaudio sink (PR coming after).
We can also give the length information to sink in more cases.

Add the support of the mark / reset methods to some common AudioStream. We then allow more stream analysis for sink requiring it (Stream analysis often requires to get back in time after consuming a few bytes)

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
2023-07-02 11:19:34 +02:00
Mark Herwege
5ceaa64768
[rest] Add widget state pattern and default unit to ItemUIRegistry (#3644)
* expose widget format pattern to sitemap REST
* Add unit fields to sitemap REST

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-07-02 11:03:00 +02:00
Scott Hraban
505e51210e
Always use ThingUid as the unique identifier for thing status metrics (#3674)
* Always use ThingUid as the unique identifier for thing status metrics

At bind time, ThingId was being used, but then ThingUid was being used when changes occured,
causing multiple meters to be created for the same Thing, with the status always being 0 for
the meter created at bind time.

This change uses the full ThingUid, for both binding and event processing, since ThingUid is
the globally unique value.

Fixes #3672

Signed-off-by: Scott Hraban <scotthraban@gmail.com>
2023-07-02 09:31:02 +02:00
Wouter Born
db97610111
Replace StringBuffer usages with StringBuilder (#3668)
See: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/StringBuilder.html

> This class provides an API compatible with StringBuffer, but with no guarantee of synchronization.
> This class is designed for use as a drop-in replacement for StringBuffer in places where the string buffer was being used by a single thread (as is generally the case).
> Where possible, it is recommended that this class be used in preference to StringBuffer as it will be faster under most implementations.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-06-25 17:24:46 +02:00
J-N-K
78e66745ab
Add support for things with generic channels (#3355)
* Add support for generic channels

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-06-25 16:22:55 +02:00
J-N-K
64fd046266
Bump spifly to 1.3.6 and asm to 9.4 to support records (#3658)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-06-23 10:46:43 +02:00
J-N-K
36f95bb5b5
Fix missing query prefix in JarFileAddonService (#3664)
See title. This brings the query id in-line with the other add-on services.

Also adds correct content type.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-06-18 21:08:47 +02:00
J-N-K
d64bd3b90b
Improve existing and add new persistence filters (#3642)
* Improve existing and add new persistence filters
* include filter

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-06-18 09:29:49 +02:00