Commit Graph

249 Commits (main)

Author SHA1 Message Date
Mark Herwege 9ad83bada4
Remove calls to deprecated URL constructor (#4551)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2025-01-12 22:18:10 +01:00
jimtng 229d87263f
Improve cron exception handling (#4553)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-01-11 09:14:54 +01:00
Wouter Born f00c7700cb
Start license headers with `/*` instead of `/**` (#4544)
Prevents JavaDoc tooling issues because these tools check comments starting with `/**`.

Signed-off-by: Wouter Born <github@maindrain.net>
2025-01-07 21:48:56 +01:00
Holger Friedrich 40d079ae80
Java 21 language features (#4535)
* Java 21 language features

* use getFirst and getLast methods
* replace new Locale by Locale.of
* replace Paths.get by Path.of
* use ThreadLocalRandom.current().nextDouble()
* add @Serial annotations

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2025-01-06 23:22:43 +01:00
Wouter Born 979e4a7409
Update license headers to 2025 (#4532)
Signed-off-by: Wouter Born <github@maindrain.net>
2025-01-01 16:40:04 +01:00
Florian Hotze cb4d4b8c74
Item triggers: Suggest using conditions that for comparing Item state (#4530)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-12-31 17:30:56 +01:00
Wouter Born db72021460
Update Eclipse files (#4514)
Signed-off-by: Wouter Born <github@maindrain.net>
2024-12-24 07:02:47 +01:00
Holger Friedrich 8d837f9823
Prepare for OH 5.0.0 (#4496)
* Prepare for OH 5.0.0

* Switch to 5.0.0-SNAPSHOT
* Fix spotless after unleash
* resolve itest runbundles
* Fix linux-specific pom

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-12-15 18:49:23 +01:00
openhab-bot 0f2e56f39d [unleash-maven-plugin] Preparation for next development cycle. 2024-12-15 11:41:19 +00:00
Jacob Laursen b31ff66bba
[core] Switch `DateTimeType` to `Instant` internally for consistent time-zone handling (#3583)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2024-12-08 16:06:29 +01:00
openhab-bot 0c93cc0456
New Crowdin updates (#4480)
* New translations addons.properties (Catalan)
* New translations addons.properties (Czech)
* New translations audio.properties (Catalan)
* New translations automation.properties (Catalan)
* New translations automation.properties (Czech)
* New translations chart.properties (Catalan)
* New translations chart.properties (Czech)
* New translations defaultsystemchannels.properties (Catalan)
* New translations defaultsystemchannels.properties (Czech)
* New translations ephemeris.properties (Catalan)
* New translations firmware.properties (Catalan)
* New translations hli.properties (Catalan)
* New translations i18n.properties (Catalan)
* New translations inbox.properties (Catalan)
* New translations jsonstorage.properties (Catalan)
* New translations jsr223.properties (Catalan)
* New translations jsr223.properties (Czech)
* New translations languagesupport.properties (Catalan)
* New translations languagesupport.properties (Portuguese)
* New translations languagesupport.properties (Portuguese, Brazilian)
* New translations lsp.properties (Catalan)
* New translations magic.properties (Catalan)
* New translations marketplace.properties (Catalan)
* New translations messages.properties (Catalan)
* New translations network.properties (Catalan)
* New translations persistence.properties (Catalan)
* New translations restauth.properties (Catalan)
* New translations scriptprofile.properties (Catalan)
* New translations scriptprofile.properties (Czech)
* New translations sitemap.properties (Catalan)
* New translations systemprofiles.properties (Catalan)
* New translations systemprofiles.properties (Czech)
* New translations systemthingstatusinfos.properties (Catalan)
* New translations tags.properties (Catalan)
* New translations units.properties (Catalan)
* New translations units.properties (Czech)
* New translations validation.properties (Catalan)
* New translations validation.properties (Czech)
* New translations voice.properties (Catalan)
* New translations voice.properties (Czech)
2024-12-08 11:45:41 +01:00
Florian Hotze 7005c7f15e
ConfigDescriptionParameter & Input: Add null annotations & improve JavaDoc (#4465)
* Add null annotations to org.openhab.core.automation.type.Input
* Add null annotations to org.openhab.core.config.core.ConfigDescriptionParameter

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-12-01 12:28:25 +01:00
Florian Hotze 0d031a3b78
[automation] Ensure unique module IDs for overloaded `@RuleAction` methods (#4441)
* [automation] Handle overloaded `@RuleAction`s - Append signature hash to avoid duplicate module ids.
* [automation] ThingActionsResource: Provide action visibility

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-11-10 14:11:24 +01:00
Florian Hotze 3bc9ae3e14
[automation] ActionInputsHelper: Enhance ZonedDateTime & Instant input support (#4440)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-11-08 17:59:55 +01:00
Florian Hotze a31e8376a4
[automation] ActionInputsHelper: Set step size to 1 for datetime & time to enable seconds (#4436)
Refs https://github.com/openhab/openhab-webui/pull/2848.
Discussion in https://github.com/openhab/openhab-webui/issues/2847#issuecomment-2446426478.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-11-06 09:17:29 +01:00
lolodomo bc6731157c
Add support for more types as output of thing actions (#4435)
Byte
Short
Long
BigDecimal
QuantityType
LocalDate
LocalTime
LocalDateTime
ZonedDateTime
Instant
Duration

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-11-04 10:40:31 +01:00
Florian Hotze 7f5fbbb22f
Thing actions: Process `@ActionOutput` for actions with single return value & Enforce proper annotations (#4430)
See discussion in https://github.com/openhab/openhab-addons/issues/17504#issuecomment-2439906483.

This adds processing of the ActionOutput annotation for Thing actions with a single return value, which allows providing a label for use in the UI.
The output name for those actions is "result", which is now the default value in the @ActionOutput annotation. If a binding overrides the default name, a warning is logged.

If a Thing action returns a Map<String, Object> but does not provide the @ActionOutputs annotation, a warning is logged.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-10-27 19:53:19 +01:00
Florian Hotze 52b26baf17
ActionInputsHelper: Allow any number of decimals & Apply primitive input default values (#4424)
* ActionInputHelper: Set step site to 0 if param type decimal

This makes the UI allow any step size, i.e. entering any number of decimals.

Signed-off-by: Florian Hotze <dev@florianhotze.com>

* ActionInputHelper: Apply default values when mapping from serialised to action inputs

This has been forgotten to be implemented.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-10-26 21:49:18 +02:00
Florian Hotze ae1f763b62
ConfigDescriptionParameter: Change default format for datetime & Update context docs (#4428)
* ConfigDescriptionParameter: Change default format for datetime & Update context docs

This changes the default format for the datetime context to the ISO standard.
This context is not used by add-ons and supported by the UI, so it should be possible to change it (again after #4392.)

Also update the context docs from https://next.openhab.org/docs/developer/addons/config-xml.html#supported-contexts and the UI code.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-10-26 20:31:08 +02:00
Florian Hotze 63788b061b
ActionOutput: Document QR code rendering & Fix action REST doc (#4421)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-10-26 09:12:11 +02:00
Holger Friedrich fa73d3cb49 Fix JavaDoc
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-10-25 08:03:46 +02:00
lolodomo d431013198
Enhance ThingActions UI support (#4392)
* Enhance ThingActions UI support

Fixes #1745

Return config description parameters for the ActionInputs of ThingActions for the REST GET /action/{thingUID} and REST GET /module-types endpoints.
The config description parameters are only provided if all input parameters have a type that can be mapped to a config description parameter (String, boolean, Boolean, byte, Byte, short, Short, int, Integer, long, Long, float, Float, double, Double, Number, DecimalType, QuantityType<?>, LocalDateTime, LocalDate, LocalTime, ZonedDateTime, Date, Instant and Duration).

Enhance the REST POST /actions/{thingUID}/{actionUid} endpoint (allows invoking Thing actions via REST) and the AnnotationActionHandler (allows invoking Thing actions from UI-rules) in order to be more flexible regarding the type of each provided argument value and to map the value to the expected data type. Number and string values will be accepted as inputs and the expected data type will be created from this value.

This will be used by the UI's Thing page and rule editor to allow invoking Thing actions through the UI or adding them to UI-bases rules.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-10-20 12:39:30 +02:00
openhab-bot 963a8d1a5f
New Crowdin updates (#4408)
* New translations tags.properties (Hungarian)
* New translations addons.properties (Spanish)
* New translations units.properties (Spanish)
* New translations validation.properties (Norwegian)
* New translations addons.properties (Norwegian)
* New translations voice.properties (Norwegian)
* New translations systemprofiles.properties (Norwegian)
* New translations chart.properties (Norwegian)
* New translations defaultsystemchannels.properties (Norwegian)
* New translations i18n.properties (Finnish)
* New translations i18n.properties (Norwegian)
* New translations automation.properties (Hebrew)
* New translations languagesupport.properties (Portuguese)
* New translations languagesupport.properties (Portuguese, Brazilian)
2024-10-08 01:28:25 +02:00
jimtng 3c7b4b89b1
Add offset and timeOnly config in TimerEvent payload (#4378)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2024-09-15 21:20:29 +02:00
jimtng 69dc83237b
Support offset in DateTimeTrigger (#4271)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2024-09-08 07:54:45 +02:00
Holger Friedrich fc454883c2
Reduce SAT warnings (#4339)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-08-11 10:04:26 +02:00
Florian Hotze e1574488b6
[rules] Don't attempt to pre-compile disabled rules (#4329)
Fixes an issue, where an error that compilation failed for disabled rules.
Reported on the community: https://community.openhab.org/t/oh-4-2-snapshot-disabled-rules-failed-to-compile-error-in-opehab-log/157402.
Follow-up for #4289.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-07-24 20:18:49 +02:00
Florian Hotze 918b4faa3b
[rules] Add support for pre-compilation of conditions and actions (#4289)
* ScriptConditionHandler/ScriptActionHandler: Add support for pre-compilation of scripts

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-07-09 19:12:33 +02:00
Kai Kreuzer 21e605d212
Apply spotless after release, resolve bundles (#4301)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2024-07-07 23:22:27 +02:00
openhab-bot 07e23eac3c [unleash-maven-plugin] Preparation for next development cycle. 2024-07-07 16:05:56 +00:00
openhab-bot 1a33e23fef
New Crowdin updates (#4285)
* New translations validation.properties (Dutch)

* New translations addons.properties (Dutch)

* New translations voice.properties (Dutch)

* New translations automation.properties (Dutch)

* New translations scriptprofile.properties (Dutch)

* New translations units.properties (Dutch)

* New translations systemprofiles.properties (Dutch)

* New translations defaultsystemchannels.properties (Dutch)

* New translations chart.properties (Dutch)

* New translations magic.properties (Dutch)

* New translations jsr223.properties (Dutch)

* New translations languagesupport.properties (Portuguese)

* New translations languagesupport.properties (Portuguese, Brazilian)
2024-06-30 10:38:54 +02:00
joerg1985 c3ada84b77
Conditionally use a thread pool backed sequential executor for DSL rules and events (#3890)
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
2024-04-29 09:11:56 +02:00
Holger Friedrich fa9cff6be9
GsonBuilder: Explicitly set date format (#4185)
Between Java 17 and Java 21, serialization of DateTime has changed due to
CLDR 42 which uses a narrow non-breaking space.
To ease switching JDK versions, the seralization format is explicitly
set to the Java 17 format.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-04-28 17:11:54 +02:00
Holger Friedrich b563f1577a
More instanceof pattern matching (#4191)
* More instanceof pattern matching

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-04-21 21:22:37 +02: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 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
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
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
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 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 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 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 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