Commit Graph

487 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
Jacob Laursen
e8641efd5b
Provide I18N properties for Unit Settings (#3941) 2023-12-20 12:34:58 +01:00
Wouter Born
81f14c9df1
Upgrade logback-classic to 1.3.14 (#3935) 2023-12-19 23:26:22 +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
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
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
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
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
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
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
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
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
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
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
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
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