Commit Graph

347 Commits

Author SHA1 Message Date
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