Commit Graph

438 Commits

Author SHA1 Message Date
Holger Friedrich
74052e7bcd
Code cleanup: Use Java17 features (#3508)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-04-01 09:51:12 +02:00
J-N-K
4182980ec8
Add ItemStateUpdatedEvent and enable group channel-links (#3141)
* Add (Group)ItemStateUpdatedEvent

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-31 23:01:40 +02:00
GiviMAD
4d0dba1abc
Fix OOBE in item metadata descriptions providers (#3488)
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-03-30 20:33:21 +02:00
J-N-K
6294c48be4
Use try-with-resources on Files.walk/Files.list (#3504)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-29 09:54:41 +02:00
GiviMAD
b6c8aeaf10
Allow using quotes in metadata state/command description value/label (#3363)
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-03-26 19:30:21 +02:00
J-N-K
9289fd5a78
Bump spotless and fix formatting (#3469)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-20 23:14:59 +01:00
J-N-K
a32f1e0253
Add ColorUtil for better support of xyY conversion (#3434)
* Add ColorUtil for better support of xyY conversion

This has been refactored to align with the usually used conversion by a lot of ZigBee products like Hue or Deconz.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-16 22:25:03 +01:00
J-N-K
c05fe8ad4d
Fix ready marker ordering on late subscriptions (#3454)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-13 21:15:55 +01:00
jimtng
f9751448c1
Fix ISE during WatchService disposal (#3432)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2023-03-07 15:43:45 +01:00
J-N-K
278e99b461
Fix IllegalStateException in WatchServiceImpl (#3389)
Added a check to prevent attempts to unregister already unregistered service

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-05 09:44:58 +01:00
J-N-K
07e8ff56c7
Prevent duplicate events in WatchService (#3404)
On Samba shares a single MODIFY event may result in different sequences of CREATE/DELETE/MODIFY events. Unfortunately this is not properly handled by the underlying library and we have to re-introduce our ugly workaround. The solution itself is a bit improved over the old one as it not only keeps the last event but determines the correct event by examining the sequence of received events.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-05 09:44:23 +01:00
Wouter Born
ec3af50f11
Upgrade to Karaf 4.4.3 (#3252)
* Sync runtime dependencies with Karaf 4.4.3, most notably:
  * Jetty 9.4.50.v20221201
  * Pax Logging 2.2.0
  * Pax Web 8.0.15
* Use OSGi R8 as compile dependency
* Rework Servlets to use Http Whiteboard annotations in favor of proprietary `org.openhab.core.io.http.servlet` classes
* Resolve itest runbundles

Also-by: Jan N. Klug <github@klug.nrw>

Signed-off-by: Wouter Born <github@maindrain.net>
2023-03-01 13:09:07 +01:00
Gwendal Roulleau
5544945d48
[tts] Cache mechanism (#3057)
* [tts] Cache mechanism

Implements a cache mechanism for all TTS services.
Eviction policy is LRU mode.
This cache can serve several streams concurrently, for the same utterance, with only one call to the TTS. It doesn't wait for the stream to end and can serve data rapidly.
Cache size is a voice bundle parameter (10 mb default)

Closes #3039

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
2023-02-28 08:45:44 +01:00
openhab-bot
ccef3d24ff
New Crowdin updates (#3395)
* New translations DefaultSystemChannels.properties (Czech)

* New translations addons.properties (Czech)

* New translations marketplace.properties (Czech)

* New translations restauth.properties (Czech)

* New translations voice.properties (Czech)

* New translations validation.properties (Czech)
2023-02-24 20:25:02 +01:00
J-N-K
dff6f9b984
Refactor XML handling (#3385)
* Refactor XML handling for things
* integrate config.xml and improve naming

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-02-23 20:06:29 +01:00
J-N-K
c17481c2ac
Align AbstractScriptDependencyTracker with AbstractScriptFileWatcher (#3372)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-02-18 09:17:59 +01:00
Cody Cutrer
474d24c62d
Refactor GenericEventTrigger and GenericEventCondition (#3299)
* rework GenericEventTrigger and GenericEventCondition

fixes #3234

to make their interfaces and semantics match, as well as having a
well defined (and useful) way of defining topic filters

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-02-14 09:07:23 +01:00
J-N-K
fcb8dee9a6
Improve handling of erroneous localized messages (#3366)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-02-12 17:04:33 +01:00
J-N-K
7f113c51bc
Refactor WatchService (#3004)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-02-12 14:12:22 +01:00
Kai Kreuzer
304617c5b7
Remove author from addon xsd (#3362)
* Remove author from addon xsd

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-02-11 19:50:05 +01:00
J-N-K
f67809a5e8
Fix CME in JarFileAddonService (#3351)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-02-04 15:43:45 +01:00
lolodomo
14bae356c2
Consider language in KarafAddonService when creating Addon (#3341)
* [REST] Consider language when retrieving installed addons

Fix openhab/openhab-webui#1666

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-01-28 14:18:58 +01:00
J-N-K
673827733a
Fixes and enhancements for add-on services (#3293)
* Add an add-on service that provides add-ons in the addons-folder
* fix connection and countries

This is needed to show the add-ons from the addons in the UI.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-01-21 22:07:48 +01:00
Kai Kreuzer
10eb42af3f
Fix nullable errors (#3319)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-01-15 19:03:59 +01:00
J-N-K
3d54ee54d2
Introduce metadata for all add-ons (#3050)
* Introduce addon.xml

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-01-15 15:31:42 +01:00
J-N-K
a09ad3d37c
Ensure metadata available at startlevel 20 (#3273)
* Ensure metadata available at start-level 20

This makes the `MetadataRegistry` report when the elements of the `ManagedMetadataProvider` is available via a ready marker (like other registries).

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-01-10 22:24:26 +01:00
J-N-K
fd5b451e59
Log the version/build on startup (#3270)
* Log the version/build on startup

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-01-10 22:13:44 +01:00
Cody Cutrer
d8a2c19609
Prevent a provider from removing elements added by another provider (#3301)
* prevent a provider from removing an element from another provider

if multiple providers provide the same element, the added callback
simply ignores the duplicates. but the provider has no idea its element
was ignored, so it may try to remove it in the future, and things will
get all out of whack if the element is removed from the registry even
if another provider thinks it's still there

this is easily reproducible by creating an item in the UI, then
creating the same item via a .items file, and then removing the item
from the .items file. The item will seem like it is gone to most
of openHAB, but will come back after reboot when the managed
provider re-adds.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-01-09 19:29:14 +01:00
Sami Salonen
ef34e5b0b4
QuantityType.as(PercentType.class) fixes with dimensionless units (#3297)
* QuantityType.as(PercentType.class) fixes with dimensionless units

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
2023-01-05 18:51:58 +01:00
stefan-hoehn
084f9779a7
Add method to get namespaces to MetadataRegistry and ItemResource (#3298)
* add retrieve namespaces for item

Signed-off-by: Stefan Höhn <stefan.hoehn@nfon.com>
2023-01-03 18:27:17 +01:00
Cody Cutrer
8be306a5bc
Cleanup event filtering and improve EventFilter usage (#3295)
* don't use event.topics OSGi service property
* use TopicPrefixEventFilter

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-01-03 16:30:12 +01:00
J-N-K
8d64ecfd8d
Update license header to 2023 (#3294)
* Update license header to 2023

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-01-03 09:45:42 +01:00
Jacob Laursen
100aa6e838
Add method to DateTimeType for returning Instant (#3287)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2022-12-30 20:40:58 +01:00
J-N-K
98b4902c4a
Remove AccessController.doPrivileged calls (#3271)
The `AccessController` and the `SecurityManager` is deprecated for removal in Java 17. We don't make use of the `SecurityManager` anyway, so we can safely remove it.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-12-30 16:32:34 +01:00
Wouter Born
a3dc57784a
Remove wrong DataAmount units (#3261)
These wrong DataAmount units were added in #3208 for backwards compatibility.
In OH4 we can clean them up because this major version allows for breaking changes.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-12-23 23:51:28 +01:00
Wouter Born
7888da1684
Fix some recently introduced SAT and NPE issues (#3251)
Signed-off-by: Wouter Born <github@maindrain.net>
2022-12-22 15:11:49 +01:00
Wouter Born
687688db7e
Update Eclipse .classpath files (#3250)
Also adds some missing files for recently added projects.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-12-22 14:14:35 +01:00
Дилян Палаузов
d48ac20377
typo: successful (#3236) 2022-12-19 15:45:17 +01:00
J-N-K
5a9fb679ef
Remove redundant ctor in DecimalType (#3240)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-12-19 15:44:18 +01:00
J-N-K
3fc4d23734
Fix spotless and resolve itests (#3239)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-12-19 11:09:31 +01:00
openhab-bot
35254b3a0a [unleash-maven-plugin] Preparation for next development cycle. 2022-12-18 23:08:22 +00:00
J-N-K
08d7d13c9b
Fix default unit for Energy (#3213)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-12-11 12:06:49 +01:00
J-N-K
94b8c2a540
Fix DataAmount dimension units (#3208)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-12-11 11:00:50 +01:00
J-N-K
1b8280812b
Fix AVG calculation in GroupFunction (#3202)
Reported on the forum. Due to selection of the `RoundingMode` instead of a `MathContext` the average calculation is returning unexpected results: 19.0 °C / 19.5 °C results in 19.3 °C (instead of 19.25 °C) which might be acceptable, but 19.5 °C / 19.5 °C results in 20 °C (instead of 19.5 °C) which is obviously not what we want or expect. Setting the `MathContext` fixes this problem. I also corrected the same calculation for non-dimensional groups.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-12-10 16:02:35 +01:00
J-N-K
d10cae0631
Improve UoM handling (#3201)
Also-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-12-07 15:55:02 +01:00
Дилян Палаузов
f64874e226
Fix a/an typos (#3184) 2022-11-30 21:16:18 +01:00
Дилян Палаузов
e556fdf81b
Fix a/an typos (#3181)
* Typos a/an
* Fix typo generation in generateTagClasses.groovy

Signed-off-by: Wouter Born <github@maindrain.net>
2022-11-29 20:57:48 +01:00
Cody Cutrer
af3738487c
add QuantityType.toUnitRelative (#3177)
this is a useful helper that can eliminate some complicated code elsewhere.
starting in SystemOffsetProfile. then I also want to use it in the homekit
addon.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-11-27 10:09:52 +01:00
lolodomo
27b847f40c
Define format method for HSBType (#3165)
Pattern %s will match <hue>,<saturation>,<brightness>
Pattern %hsb% will match <hue>,<saturation>,<brightness>
Pattern %rgb% will match <red>,<green>,<blue>

Related to discussion in openhab/openhab-webui#427

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2022-11-26 16:00:54 +01:00
J-N-K
d00d14d9fc
Add default units for all dimensions (#3143)
* Add default units for all dimensions

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-19 23:10:38 +01:00
J-N-K
4f35d474fc
Strip unit if NumberItem has no dimension (#3153)
* Strip unit if NumberItem has no dimension

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-19 23:05:55 +01:00
J-N-K
2bceba6954
Fix missing stateDescriptionProvider in Group items (#3144)
* Fix missing stateDescriptionProvider in Group items

The stateDescriptionProvider was not properly passed to the base item. Because of that units set in the state description were not properly used when setting the group state after calculating aggregation functions.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-06 20:50:05 +01:00
Cody Cutrer
a7d912d1e9
Fix invertible unit conversions when sent via a binding or uses in ItemUIRegistry (#3134)
* fix invertible unit conversions when sent via a binding
* do invertible unit conversion in ItemUIRegistry

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-10-27 20:26:27 +02:00
Cody Cutrer
ccdf2c5573
Allow sending IncreaseDecreaseType directly to DimmerItem (#3116)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-10-17 08:05:02 +02:00
Cody Cutrer
3659542bae
Support mired units (#3108)
* Support mired units

Mired are fairly common to describe the color temperature of
lightbulbs (slightly less common than Kelvin), but are very
useful for various calculations when adjusting the color
temperature, as well as being necessary for various integerations
that require mired units.

This commit makes them a well-known unit (previously they were
still usable, using "MK^-1"), as well as making them easier to
work with on QuantityType. The hiccup is that Mireds aren't
technically a Temperature dimension, because they're a reciprocal.
So add a `inverse` method that delegates to javax.measure's
same method, and then use it as necessary when doing unit
conversions and comparisons. Unfortunately, because the
dimension changes, the return value of a conversion won't
necessarily be the same type, an additional method is added
for callers that are willing to handle the change in
dimension. This is implemented for all callers that can use
it in core.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-10-16 13:50:46 +02:00
Cody Cutrer
7f38d419c6
Allow sending QuantityType to NumberItem (#3115)
NumberItems always accept QuantityType

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-10-15 09:31:30 +02:00
openhab-bot
07be655b0e
New Crowdin updates (#3109)
* New translations automation.properties (Italian)
* New translations restauth.properties (German)
* New translations restauth.properties (Italian)
* New translations addons.properties (Italian)
* New translations restauth.properties (Danish)
* New translations restauth.properties (Finnish)
* New translations restauth.properties (Hungarian)
* New translations restauth.properties (Polish)
2022-10-15 09:27:02 +02:00
Cody Cutrer
065e33f5ab
Fix StartLevelService "hanging" if config is changed. (#3092)
Unregistered trackers aren't clear, so then we never register new trackers,
and thus never get notified of any changes.

Signed-off-by: Cody Cutrer <cody@cutrer.us>

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-09-25 09:44:57 +02:00
J-N-K
e3b90e32ce
Normalize Metadata configuration from managed provider (#2958)
* Normalize Metadata configuration from managed provider

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-09-20 21:20:27 +02:00
Jacob Laursen
9bb88a1b7b
[oauth] Migrate usage of LocalDateTime to Instant (#3066)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2022-08-22 08:13:52 +02:00
openhab-bot
c4f0ab44df
New Crowdin updates (#3054)
* New translations units.properties (Portuguese)

* New translations units.properties (Portuguese, Brazilian)

* New translations firmware.properties (Slovenian)

* New translations units.properties (Slovenian)

* New translations validation.properties (Slovenian)

* New translations messages.properties (Slovenian)

* New translations tags.properties (Danish)

* New translations tags.properties (Slovenian)

* New translations DefaultSystemChannels.properties (Slovenian)

* New translations LanguageSupport.properties (Slovenian)

* New translations SystemProfiles.properties (Slovenian)

* New translations jsonStorage.properties (Slovenian)

* New translations network.properties (Slovenian)

* New translations i18n.properties (Slovenian)

* New translations voice.properties (Slovenian)

* New translations chart.properties (Slovenian)

* New translations persistence.properties (Slovenian)

* New translations addons.properties (Slovenian)

* New translations restauth.properties (Slovenian)

* New translations ephemeris.properties (Slovenian)

* New translations inbox.properties (Slovenian)

* New translations audio.properties (Slovenian)

* New translations hli.properties (Slovenian)

* New translations lsp.properties (Slovenian)

* New translations marketplace.properties (Slovenian)

* New translations sitemap.properties (Slovenian)

* New translations SystemThingStatusInfos.properties (Slovenian)

* New translations magic.properties (Slovenian)

* New translations automation.properties (Hebrew)

* New translations automation.properties (Slovenian)
2022-08-03 18:03:28 +02:00
openhab-bot
f84d72d449
New Crowdin updates (#3043)
* New translations messages.properties (Danish)

* New translations audio.properties (Danish)

* New translations inbox.properties (Danish)

* New translations addons.properties (Danish)

* New translations persistence.properties (Danish)

* New translations lsp.properties (Danish)

* New translations sitemap.properties (Danish)

* New translations SystemThingStatusInfos.properties (Danish)
2022-07-15 19:16:14 +02:00
openhab-bot
d92a2c6945
New Crowdin updates (#3028)
* New translations units.properties (Portuguese)

* New translations DefaultSystemChannels.properties (Norwegian)

* New translations tags.properties (Norwegian)

* New translations SystemProfiles.properties (Norwegian)

* New translations audio.properties (Norwegian)

* New translations voice.properties (Norwegian)

* New translations ephemeris.properties (Norwegian)

* New translations inbox.properties (Norwegian)

* New translations restauth.properties (Norwegian)

* New translations addons.properties (Norwegian)

* New translations persistence.properties (Norwegian)

* New translations jsonStorage.properties (Norwegian)

* New translations chart.properties (Norwegian)

* New translations i18n.properties (Norwegian)

* New translations network.properties (Norwegian)

* New translations lsp.properties (Norwegian)

* New translations sitemap.properties (Norwegian)

* New translations hli.properties (Norwegian)

* New translations marketplace.properties (Norwegian)

* New translations magic.properties (Norwegian)

* New translations validation.properties (Norwegian)

* New translations SystemThingStatusInfos.properties (Norwegian)

* New translations units.properties (Portuguese, Brazilian)
2022-07-04 15:31:54 +02:00
J-N-K
f79f8c348e
Improve UID error message (#3022)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-06-29 21:54:31 +02:00
Kai Kreuzer
61fd47c853
Apply spotless and resolver (#3018)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2022-06-27 13:41:28 +02:00
openhab-bot
8944bdbbe4 [unleash-maven-plugin] Preparation for next development cycle. 2022-06-26 16:37:00 +00:00
Kai Kreuzer
2cf875fdd8
Fix ConcurrentModificationException in WatchQueueReader (#3016)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2022-06-26 17:14:51 +02:00
openhab-bot
cdeda77322
New Crowdin updates (#3013) 2022-06-24 18:19:02 +02:00
J-N-K
c2ec97cfaf
Add ability to name timers / scheduled jobs (#2911)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-06-18 15:04:35 +02:00
J-N-K
344a9ae018
Fix log levels and duplicate implementation warning in tests (#2982)
* Fix log levels and duplicate implementation warning in tests

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-05-26 23:33:08 +02:00
J-N-K
792b7511bf
Fix item name checking in ItemUtil (#2941)
* Fix item name checking in ItemUtil

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-05-21 09:29:42 +02:00
Sami Salonen
09b9b33cc0
[expire] Allow ignoring commands (#2954)
* [expiry] [expire] bool configuration parameters parsing as util method
* [expiry] [expire] extend ExpiryManager to allow ignoring commands

Similar to ignoreStateUpdates parameter, this introduces new optional
parameter ignoreCommands.

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
2022-05-11 18:30:53 +02:00
openhab-bot
bb634b9189
New Crowdin updates (#2930)
* New translations DefaultSystemChannels.properties (Italian)

* New translations DefaultSystemChannels.properties (Dutch)

* New translations DefaultSystemChannels.properties (Polish)

* New translations DefaultSystemChannels.properties (Finnish)

* New translations DefaultSystemChannels.properties (Hebrew)

* New translations DefaultSystemChannels.properties (German)

* New translations DefaultSystemChannels.properties (Hungarian)

* New translations addons.properties (Hungarian)

* New translations marketplace.properties (Hungarian)
2022-04-26 17:25:51 +02:00
J-N-K
b331066ea9
Allow changing watched directory of a WatchService (#2894)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-04-24 19:01:33 +02:00
J-N-K
ca94fd57b0
Add new module DateTimeTrigger for triggering on a DateTime state (#2923)
* Add DateTimeTrigger

This adds a new module that triggers at the time given by the state of an item.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-04-24 11:29:55 +02:00
J-N-K
ee7095d96d
Improve SaferCallerImplTest (#2922)
Failed to to unnecessary stubbing exception in https://ci.openhab.org/job/PR-openHAB-Core/4556/

Also removes unnecessary code.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-04-22 10:52:28 +02:00
J-N-K
0e7e7a37b7
Improve SchedulerImplTest (#2919)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-04-20 10:06:39 +02:00
J-N-K
7e641e12f8
Fix Metadata can't be deserialized (#2921)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-04-18 22:06:29 +02:00
Wouter Born
05fdc81b27
Improve test stability and OS compatibility (#2878)
This fixes the build being broken when building on Windows.
It also contains many fixes for timing issues which seem to impact macOS and Windows more than Linux.

* Fix .gitattributes and add *.xml_gen to fix line ending issues on Windows
* Derive fork count from CPU details in org.openhab.core tests for more stable tests on machines with fewer cores
* Adjust SafeCallerImplTest timings
* Increase ExecUtilTest timeout
* Increase SchedulerImplTest timeouts
* Increase AudioConsoleTest serveStream timeout
* Increase AudioServletTest serveStream timeout
* Increase SchedulerImplTest test timeouts
* Increase ExpireManagerTest timeout used for checking published events
* Increase PeriodicSchedulerImplTest max allowed delta
* Increase SchedulerImplTest timeouts
* Fix BundleInfoReader file stream not closed causing temp dir deletion issues on Windows
* Fix GenerateDefaultTranslationsMojoTest Windows line endings issues
* Fix GenerateDefaultTranslationsMojoTest Windows temp dir deletion problem
* Fix GenericItemProviderTest tearDown sometimes fails because of queued events
* Fix ChannelLinkNotifierOSGiTest wait for channel link events
* Fix ChannelCommandDescriptionProviderOSGiTest fails if provider not immediately registered
* Fix ChannelStateDescriptionProviderOSGiTest fails if provider not immediately registered
* Fix GenericItemChannelLinkProviderTest not waiting for async updated state to become true
* Fix GenericThingProviderTest failing due to events of previous test
* Fix InboxOSGiTest sometimes fails because of queued events
* Fix ScriptEngineOSGiTest failing because items are not yet added to registry
* Fix ThingManagerOSGiTest failing due to async handleRemoval call

Signed-off-by: Wouter Born <github@maindrain.net>
2022-04-14 23:00:33 +02:00
Wouter Born
a4353ee5ca
Fix UnitUtils.getDimensionName returns Angle instead of Dimensionless (#2895)
An Angle is also Dimensionless and because it is the first compatible unit it is always returned instead of any other Dimensionless unit.
With these changes `getDimensionName` will prefer the dimension of equal units over those of compatible units.

Fixes #2880

Signed-off-by: Wouter Born <github@maindrain.net>
2022-04-14 22:57:18 +02:00
J-N-K
4fbd4c5960
Do not allow empty last segment in UID (#2901)
* Fix empty segment in UID

Segments are not allowed to be empty. Also adds tests for UID construction.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-04-14 22:55:19 +02:00
openhab-bot
661fa00e46
New Crowdin updates (#2903)
* New translations marketplace.properties (Greek)

* New translations validation.properties (Greek)

* New translations SystemThingStatusInfos.properties (Greek)

* New translations DefaultSystemChannels.properties (Greek)

* New translations addons.properties (Greek)

* New translations voice.properties (Greek)
2022-04-09 08:57:11 +02:00
J-N-K
2a3e2e5567
Reduce Mockito warnings (#2893)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-04-03 22:36:55 +02:00
openhab-bot
f5aeba0ad7
New Crowdin updates (#2873)
* New translations DefaultSystemChannels.properties (Finnish)

* New translations DefaultSystemChannels.properties (Dutch)

* New translations marketplace.properties (Polish)

* New translations SystemThingStatusInfos.properties (Polish)

* New translations validation.properties (Polish)

* New translations voice.properties (Polish)

* New translations DefaultSystemChannels.properties (Italian)

* New translations DefaultSystemChannels.properties (Polish)

* New translations DefaultSystemChannels.properties (Hebrew)

* New translations DefaultSystemChannels.properties (German)

* New translations marketplace.properties (French)

* New translations DefaultSystemChannels.properties (French)

* New translations addons.properties (French)

* New translations marketplace.properties (French)
2022-03-27 23:22:39 +02:00
openhab-bot
22c39fb54d
New Crowdin updates (#2869)
* New translations addons.properties (Dutch)
* New translations addons.properties (Finnish)
* New translations addons.properties (German)
* New translations addons.properties (Hebrew)
* New translations addons.properties (Italian)
* New translations addons.properties (Polish)
* New translations marketplace.properties (Dutch)
* New translations marketplace.properties (Finnish)
* New translations marketplace.properties (German)
* New translations marketplace.properties (Hebrew)
* New translations marketplace.properties (Italian)
* New translations SystemThingStatusInfos.properties (Bulgarian)
* New translations units.properties (Catalan)
2022-03-25 18:44:31 +01:00
Wouter Born
b5e0ccfa6a
Add missing default translations for add-ons/marketplace configuration options (#2868)
This makes it possible to use Crowdin for translating the new configuration options introduced in #2811.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-03-23 17:45:23 +01:00
openhab-bot
7e13f7f4bd
New Crowdin updates (#2863)
* New translations addons.properties (Chinese Simplified)
* New translations addons.properties (Czech)
* New translations addons.properties (Dutch)
* New translations addons.properties (Finnish)
* New translations addons.properties (French)
* New translations addons.properties (German)
* New translations addons.properties (Greek)
* New translations addons.properties (Hebrew)
* New translations addons.properties (Hungarian)
* New translations addons.properties (Italian)
* New translations addons.properties (Polish)
* New translations addons.properties (Portuguese, Brazilian)
* New translations addons.properties (Russian)
* New translations addons.properties (Spanish)
* New translations addons.properties (Ukrainian)
* New translations i18n.properties (Danish)
* New translations magic.properties (Dutch)
* New translations marketplace.properties (Dutch)
* New translations marketplace.properties (Hebrew)
* New translations marketplace.properties (Hungarian)
* New translations marketplace.properties (Italian)
* New translations network.properties (Danish)
* New translations SystemThingStatusInfos.properties (Dutch)
* New translations units.properties (Danish)
* New translations validation.properties (Danish)
* New translations validation.properties (Dutch)
* New translations voice.properties (Dutch)
2022-03-22 21:27:45 +01:00
J-N-K
41abd57161
Increase allowed deviation in PeriodicSchedulerImplTest (#2867)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-03-22 20:46:50 +01:00
J-N-K
4577562f08
[addonservices] Add version filtering (#2811)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-03-20 18:43:07 +01:00
J-N-K
3d17049d52
Improve PeridodicSchedulerImplTest (#2856)
* Improve PeridodicSchedulerImplTest

The old implementation truncated timestamps to 1/10 s. Under some circumstances this could result in a failed tests:

offset = 201 -> truncatedOffset = 2
200ms delay expected, adjustment calculation results in an actual delay of 198ms
time = 399 -> truncatedTime = 3

expected: truncatedOffset + expected => 2 + 2 = 4
actual: truncatedTime = 3

The new implementation allows for an error of +/- 10ms which is far more than needed.

* increase tolerance
* fix consecutive executions build up errors

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-03-19 21:07:08 +01:00
Wouter Born
ba4e73ccf4
Run org.openhab.core tests in forks to reduce build time (#2837)
This saves about 1 minute when building this bundle.
Most bundles depend on org.openhab.core so cores would stay idle until this bundle is build in a parallel builds.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-03-13 12:11:11 +01:00
Wouter Born
e6ddeccd78
Add more null annotations to XML processing classes (#2775)
This adds null annotations to many XML processing classes and a few others.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-03-10 19:57:31 +01:00
J-N-K
c7aec15290
Fix missing STARTLEVEL_COMPLETE ReadyMarker (#2755)
Since no requirements are defined for `STARTLEVEL_COMPLETE´ no `ReadyMarker` was added to the map of `ReadyMarker`s.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-03-09 22:05:30 +01:00
J-N-K
f79d85da87
Re-introduce removed DecimalType ctors to maintain compatibility (#2803)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-26 13:30:56 +01:00
Wouter Born
9ff7ad43b9
Add more null annotations to automation bundles (#2763)
* Add more null annotations to automation bundles. This adds null annotations to many classes in the automation bundles and a few dimension classes.
* Further cleanup AutomationCommandExport
* Remove null from RuleStatusInfo JavaDocs. This should be clear from how the class is now annotated.
* Validate deserialized RuleStatusInfo
* Allow TriggerHandlerCallback to be triggered without providing a context

Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-25 16:40:02 +01:00
J-N-K
44f7b00c45
[rest] Add ability to change loggers and expose package names of addons (#2772)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-25 16:34:37 +01:00
kippAndMost
9e721dca36
[openhab.core] DecimalType-ctor with Number argument (#2596)
The expectation is, that when a `DecimalType` was constructed with a
`float` value, the precision of its `doubleValue()`, `floatValue()`,
`toBigDecimal()` and `toString()` is preserved. But there are `float`
values like `4.2f` or `37.1f` that cannot directly converted to `double`
without precision loss.

This commit replaces all the numerical constructors of `DecimalType`
with a single constructor with a `Number` argument, so that all `float`
values can be used without precision loss.

NOTE: There is some special handling needed for `QuantityType` and
`HSBType` because these types has a special none convential `toString`
implementation.

Signed-off-by: Ringo Frischmann <ringo.frischmann@kiwigrid.com>
2022-02-24 21:27:45 +01:00
J-N-K
2565b5cbe4
[expiry] extend ExpiryManager to allow ignoring state updates (#2739)
* [expiry] extend ExpiryManager to allow ignoring state updates

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-24 21:21:23 +01:00
Wouter Born
92917946d4
Add even more null annotations (#2752)
This PR adds even more missing null annotations which did not fit in #2742 as it grew too big.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-17 21:30:51 +01:00
Wouter Born
fb6ef20cd9
Move Java only tests from org.openhab.core.tests to org.openhab.core (#2768)
These tests only require Java and not OSGi.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-15 16:34:14 +01:00