Commit Graph

422 Commits

Author SHA1 Message Date
Christoph Weitkamp
07ee8e6ffc
Added nullness anotations to ChannelEventTriggerHandler (#2586)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-12-03 14:32:05 +01:00
Jan Vybíral
a32844358b
Prevent shutdown of shared thread pool (#760) (#2531)
Fixes #760

Signed-off-by: Jan Vybíral <jan.vybiral1@gmail.com>
2021-11-15 21:13:31 +01:00
Yannick Schaus
d4f62ed024
Add compilation errors & SAT GitHub annotations (#2543)
Signed-off-by: Yannick Schaus <github@schaus.net>
2021-11-13 22:13:28 +01:00
lolodomo
998ce26ef5
[core] Added basic exception classes which supports internationalization (#2549)
* New exception class that incorporates support for internationalization
* Add ConnectionException, CommunicationException and ConfigurationException

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2021-11-12 20:58:53 +01:00
jimtng
8343703406
Fix NPE on WatchQueueReader (#2563)
Signed-off-by: Jimmy Tanagra <jimmy@tanagra.id.au>
2021-11-11 09:43:24 +01:00
Wouter Born
bf81eaa1c2
Fix/suppress PMD CompareObjectsWithEquals findings (#2548)
Newer PMD versions discover more CompareObjectsWithEquals findings.

Related to https://github.com/openhab/static-code-analysis/pull/423

Signed-off-by: Wouter Born <github@maindrain.net>
2021-10-30 19:37:34 +02:00
Wouter Born
569dddd046
Exclude JUnit 4 from Whiteboard and update imports to JUnit 5 (#2534)
* Exclude JUnit 4 from Whiteboard and update imports to JUnit 5

Excludes the transitive JUnit 4 dependency from the Aries JAX-RS Whiteboard.
The Whiteboard should not have a compile scope dependency on JUnit so I've created https://github.com/apache/aries-jax-rs-whiteboard/pull/135 to fix this.
The wrong scope has resulted in some tests using JUnit 4 imports which is also fixed in this PR.

Signed-off-by: Wouter Born <github@maindrain.net>

* Add commonly used JUnit 4 classes to forbidden packages

Signed-off-by: Wouter Born <github@maindrain.net>
2021-10-24 10:35:28 +02:00
openhab-bot
fb8308a7a0
New Crowdin updates (#2511)
* New translations chart.properties (Russian)

* New translations hli.properties (Russian)

* New translations jsonStorage.properties (Russian)

* New translations network.properties (Russian)

* New translations audio.properties (Russian)

* New translations ephemeris.properties (Russian)

* New translations persistence.properties (Russian)
2021-10-08 18:02:58 +02:00
openhab-bot
11a96d87d6
New Crowdin updates (#2506)
* New translations addons.properties (Czech)
* New translations audio.properties (Czech)
* New translations brokerConnectionInstance.properties (Czech)
* New translations chart.properties (Czech)
* New translations DefaultSystemChannels.properties (Czech)
* New translations ephemeris.properties (Czech)
* New translations hli.properties (Czech)
* New translations i18n.properties (Czech)
* New translations inbox.properties (Czech)
* New translations jsonStorage.properties (Czech)
* New translations lsp.properties (Czech)
* New translations marketplace.properties (Czech)
* New translations marketplace.properties (Dutch)
* New translations marketplace.properties (Ukrainian)
* New translations network.properties (Czech)
* New translations persistence.properties (Czech)
* New translations restauth.properties (Czech)
* New translations sitemap.properties (Czech)
* New translations SystemProfiles.properties (Czech)
* New translations tags.properties (Czech)
* New translations voice.properties (Czech)
2021-10-05 22:49:21 +02:00
J-N-K
06f8107430
replace multi-parameter constructor with builder on org.openhab.core.Addon (#2499)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
2021-09-29 20:28:15 +02:00
Wouter Born
ba6386d83b
Use CoreItemFactory item type constants in tests (#2497)
This prevents typos and using the constants makes it easier to find out what other items types are accepted.
It also makes it easier to see that these values are item types and not labels or descriptions.

Signed-off-by: Wouter Born <github@maindrain.net>
2021-09-27 07:34:58 +02:00
J-N-K
4569eea519
Extend marketplace to accept kar and some improvements (#2490)
Also-by: Wouter Born <github@maindrain.net>
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
2021-09-23 17:07:34 +02:00
Wouter Born
41a535bf1c
Metrics improvements and fixes (#2486)
* Fix StringIndexOutOfBoundsException when using rules file name that starts with 'state' (Constant Warnings in RuleMetric #2472)
* Null annotations fixes/improvements
* Add transitive com.codahale.metrics dependency which is used by io.micrometer.core.instrument.dropwizard.DropwizardMeterRegistry. This fixes a NoClassDefFoundError when implementing metrics exporters that use a MeterRegistry extending DropwizardMeterRegistry (e.g. JmxMeterRegistry).
* Prevent ConcurrentModificationException in ThreadPoolMetric at startup:

java.util.ConcurrentModificationException: null
	at java.util.WeakHashMap$HashIterator.nextEntry(WeakHashMap.java:807) ~[?:?]
	at java.util.WeakHashMap$KeyIterator.next(WeakHashMap.java:840) ~[?:?]
	at java.lang.Iterable.forEach(Iterable.java:74) ~[?:?]
	at org.openhab.core.io.monitor.internal.metrics.ThreadPoolMetric.bindTo(ThreadPoolMetric.java:55) ~[?:?]
	at org.openhab.core.io.monitor.internal.DefaultMetricsRegistration.lambda$0(DefaultMetricsRegistration.java:97) ~[?:?]
	at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
	at org.openhab.core.io.monitor.internal.DefaultMetricsRegistration.registerMeters(DefaultMetricsRegistration.java:97) ~[?:?]
	at org.openhab.core.io.monitor.internal.DefaultMetricsRegistration.onReadyMarkerAdded(DefaultMetricsRegistration.java:115) ~[?:?]
	at org.openhab.core.internal.service.ReadyServiceImpl.lambda$0(ReadyServiceImpl.java:52) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[?:?]
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) ~[?:?]
	at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1746) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) ~[?:?]
	at org.openhab.core.internal.service.ReadyServiceImpl.notifyTrackers(ReadyServiceImpl.java:79) ~[?:?]
	at org.openhab.core.internal.service.ReadyServiceImpl.markReady(ReadyServiceImpl.java:52) ~[?:?]
	at org.openhab.core.service.StartLevelService.setStartLevel(StartLevelService.java:248) ~[?:?]
	at org.openhab.core.service.StartLevelService.lambda$0(StartLevelService.java:125) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]

Most likely another issue is that the ThreadPoolMetric does not add metrics for thread pools that are created on demand.

Fixes #2472

Signed-off-by: Wouter Born <github@maindrain.net>
2021-09-15 22:32:53 +02:00
Fabian Wolter
ea26451f66
[StartLevel] Use wrapped scheduler to make swallowed exceptions visible (#2481)
Signed-off-by: Fabian Wolter <github@fabian-wolter.de>
2021-09-15 19:33:21 +02:00
Yannick Schaus
2663a3fc7e
Community Marketplace Add-on Service - initial contribution (#2405)
Signed-off-by: Yannick Schaus <github@schaus.net>
2021-09-14 09:04:04 +02:00
openhab-bot
95da7021d9
New Crowdin updates (#2431)
* New translations tags.properties (German)

* New translations sitemap.properties (Ukrainian)

* New translations network.properties (Italian)

* New translations hli.properties (Greek)

* New translations lsp.properties (Greek)

* New translations validation.properties (Greek)

* New translations units.properties (Greek)

* New translations messages.properties (Greek)

* New translations firmware.properties (Greek)

* New translations i18n.properties (Greek)

* New translations jsonStorage.properties (Greek)

* New translations persistence.properties (Greek)

* New translations addons.properties (Greek)

* New translations restauth.properties (Greek)

* New translations ephemeris.properties (Greek)

* New translations inbox.properties (Greek)

* New translations audio.properties (Greek)

* New translations sitemap.properties (Greek)

* New translations tags.properties (Greek)

* New translations DefaultSystemChannels.properties (Greek)

* New translations chart.properties (Greek)

* New translations network.properties (Greek)

* New translations voice.properties (Greek)

* New translations brokerConnectionInstance.properties (Greek)

* New translations LanguageSupport.properties (Greek)

* New translations SystemProfiles.properties (Greek)
2021-08-31 22:29:06 +02:00
J-N-K
67d9bf5f0e
fix filename stripping (#2442)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
2021-07-31 19:07:24 +02:00
Carmine Gianni
7d5f95c078
Corrected a typo (#2444)
Signed-off-by: Carmine Gianni <carmixdev@gmail.com>
2021-07-31 19:04:08 +02:00
Kai Kreuzer
5a667cc868 applied spotless
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-06-27 23:22:02 +02:00
jenkins
b8d2077805 [unleash-maven-plugin] Preparation for next development cycle. 2021-06-27 15:50:02 +00:00
Christoph Weitkamp
57c716bf80
Create a deep copy of the first found fragment before merging other fragments into it (#2412)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-06-24 18:34:24 +02:00
openhab-bot
8e3f87a212
New Crowdin updates (#2403)
* New translations network.properties (Swedish)

* New translations i18n.properties (Swedish)

* New translations inbox.properties (Swedish)

* New translations i18n.properties (Russian)

* New translations chart.properties (Swedish)

* New translations ephemeris.properties (Swedish)

* New translations DefaultSystemChannels.properties (Swedish)

* New translations firmware.properties (Swedish)

* New translations restauth.properties (Swedish)

* New translations jsonStorage.properties (Swedish)

* New translations voice.properties (Swedish)

* New translations LanguageSupport.properties (Swedish)

* New translations validation.properties (Swedish)

* New translations SystemProfiles.properties (Swedish)

* New translations hli.properties (Portuguese, Brazilian)

* New translations lsp.properties (Portuguese, Brazilian)

* New translations SystemProfiles.properties (Portuguese, Brazilian)

* New translations addons.properties (Portuguese, Brazilian)

* New translations persistence.properties (Portuguese, Brazilian)

* New translations jsonStorage.properties (Portuguese, Brazilian)

* New translations chart.properties (Portuguese, Brazilian)

* New translations voice.properties (Portuguese, Brazilian)

* New translations brokerConnectionInstance.properties (German)
2021-06-23 16:45:11 +02:00
Christoph Weitkamp
556d3498c1
Added 'ChannelDescriptionChangedEvent' (#1505)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-06-21 13:03:37 +02:00
openhab-bot
8dbed1c553
New Crowdin updates (#2395)
* New translations validation.properties (Arabic)

* New translations units.properties (Turkish)

* New translations network.properties (Chinese Simplified)

* New translations i18n.properties (Chinese Simplified)

* New translations audio.properties (Chinese Simplified)

* New translations validation.properties (Turkish)

* New translations persistence.properties (Chinese Simplified)

* New translations voice.properties (Chinese Simplified)

* New translations chart.properties (Chinese Simplified)

* New translations jsonStorage.properties (Chinese Simplified)

* New translations addons.properties (Chinese Simplified)

* New translations restauth.properties (Chinese Simplified)

* New translations ephemeris.properties (Chinese Simplified)

* New translations inbox.properties (Chinese Simplified)

* New translations brokerConnectionInstance.properties (Chinese Simplified)

* New translations lsp.properties (Chinese Simplified)

* New translations hli.properties (Chinese Simplified)

* New translations DefaultSystemChannels.properties (Chinese Simplified)

* New translations LanguageSupport.properties (Chinese Simplified)

* New translations messages.properties (Chinese Simplified)

* New translations validation.properties (Chinese Simplified)

* New translations units.properties (Chinese Simplified)

* New translations units.properties (Arabic)

* New translations firmware.properties (Chinese Simplified)

* New translations SystemProfiles.properties (Chinese Simplified)

* New translations ephemeris.properties (Spanish)

* New translations i18n.properties (Spanish)

* New translations voice.properties (Spanish)

* New translations addons.properties (Spanish)

* New translations tags.properties (Chinese Simplified)

* New translations units.properties (Swedish)

* New translations audio.properties (Swedish)

* New translations brokerConnectionInstance.properties (Ukrainian)

* New translations SystemProfiles.properties (Ukrainian)
2021-06-09 22:09:51 +02:00
jsjames
c033741b29
[UoM] Added SQUARE_INCH, CUBIC_INCH, GALLON_LIQUID_US and GALLON_PER_MINUTE (#2401)
Added SQUARE_INCH, CUBIC_INCH, GALLON_LIQUID_US and GALLON_PER_MINUTE
Corrected type for of SQUARE_FOOT and CUBIC_FOOT to be Unit<Area> and Unit<Volume>, respectively

Signed-off-by: Jeff James <jeff@james-online.com>
2021-06-08 21:45:39 +02:00
Christoph Weitkamp
8acaa8994f
Added nullness annotations to Item events (#2384)
* Added nullness annotations to Item events
* Added nullness annotations to tests

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-05-30 18:27:15 +02:00
openhab-bot
a52bb42481
New Crowdin updates (#2390)
* New translations network.properties (French)

* New translations restauth.properties (French)
2021-05-30 10:15:05 +02:00
openhab-bot
0ffb5aad72
New Crowdin updates (#2387)
* New translations restauth.properties (French)

* New translations i18n.properties (French)

* New translations network.properties (French)
2021-05-30 08:10:24 +02:00
openhab-bot
e2511cd894
New Crowdin updates (#2375)
* New translations persistence.properties (French)

* New translations lsp.properties (French)

* New translations jsonStorage.properties (French)

* New translations chart.properties (French)

* New translations SystemProfiles.properties (Hebrew)

* New translations SystemProfiles.properties (Italian)

* New translations SystemProfiles.properties (German)

* Update source file SystemProfiles.properties

* New translations SystemProfiles.properties (German)

* New translations SystemProfiles.properties (Dutch)

* New translations SystemProfiles.properties (Finnish)

* New translations audio.properties (Polish)

* New translations lsp.properties (Polish)

* New translations hli.properties (Polish)

* New translations persistence.properties (Polish)

* New translations network.properties (Polish)

* New translations i18n.properties (Polish)

* New translations chart.properties (Polish)

* New translations jsonStorage.properties (Polish)

* New translations addons.properties (Polish)

* New translations restauth.properties (Polish)

* New translations ephemeris.properties (Polish)

* New translations voice.properties (Polish)

* New translations inbox.properties (Polish)

* New translations inbox.properties (Hungarian)

* New translations ephemeris.properties (Hungarian)

* New translations restauth.properties (Hungarian)

* New translations addons.properties (Hungarian)

* New translations jsonStorage.properties (Hungarian)

* New translations voice.properties (Hungarian)

* New translations i18n.properties (Hungarian)

* New translations lsp.properties (Hungarian)

* New translations brokerConnectionInstance.properties (Hungarian)

* New translations hli.properties (Hungarian)

* New translations inbox.properties (French)

* New translations addons.properties (French)

* New translations audio.properties (French)

* New translations SystemProfiles.properties (Hungarian)

* New translations SystemProfiles.properties (Polish)

* New translations ephemeris.properties (French)
2021-05-27 17:44:29 +02:00
Wouter Born
696ebacdc7
Rework thrown exceptions for DecimalType, PercentType and QuantityType (#2374)
Throw NumberFormatException when numbers are invalid and cannot be parsed to BigDecimals.
Add JavaDocs to document when which exception is thrown.
Add more unit tests to cover the thrown exceptions.

Signed-off-by: Wouter Born <github@maindrain.net>
2021-05-20 20:37:46 +02:00
Wouter Born
3c30177269
Support parsing localized strings with DecimalType, PercentType and QuantityType (#2365)
Adds constructors with a Locale parameter for parsing localized string to DecimalType, PercentType and QuantityType.
This allows for parsing locale specific group and decimal seperators in strings.

Also fixes:
* IllegalArgumentException not being thrown if numbers in strings are only partially parsed as QuantityType
* MeasurementParseException not caught and rethrown as IllegalArgumentException

Several new unit tests cover the new functionality and fixed regressions.

Signed-off-by: Wouter Born <github@maindrain.net>
2021-05-19 21:21:22 +02:00
Christoph Weitkamp
22cbc9a08a
Catch MeasurementParseException in UnitUtils.parseUnit(String) method (#2367)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-05-16 19:43:58 +02:00
Christoph Weitkamp
ba53e8a08d
[profiles] Added "timestamp-offset" Profile (#2351)
* Added timestamp-offset Profile
* Fix RAWBUTTON_TOGGLE_ROLLERSHUTTER Profile

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-05-15 19:39:24 +02:00
Wouter Born
568881a678
Fix decimal separator issues when creating QuantityType from String (#2362)
* Fix decimal separator issues when creating QuantityType from String

Fixes #2360

Signed-off-by: Wouter Born <github@maindrain.net>
2021-05-14 09:11:25 +02:00
openhab-bot
ff1d702f5d
New Crowdin updates (#2352)
* New translations audio.properties (Hungarian)
* New translations audio.properties (Portuguese, Brazilian)
* New translations brokerConnectionInstance.properties (Dutch)
* New translations brokerConnectionInstance.properties (Finnish)
* New translations brokerConnectionInstance.properties (Hebrew)
* New translations brokerConnectionInstance.properties (Italian)
* New translations brokerConnectionInstance.properties (Ukrainian)
* New translations chart.properties (Hungarian)
* New translations ephemeris.properties (Portuguese, Brazilian)
* New translations hli.properties (Ukrainian)
* New translations i18n.properties (Portuguese, Brazilian)
* New translations inbox.properties (Portuguese, Brazilian)
* New translations lsp.properties (Ukrainian)
* New translations network.properties (Hungarian)
* New translations network.properties (Portuguese, Brazilian)
* New translations persistence.properties (Hungarian)
* New translations restauth.properties (Portuguese, Brazilian)
2021-05-12 18:59:30 +02:00
Wouter Born
0e9cecc29b
Fix unstable CronSchedulerImplTest (#2354)
This test would often fail when the system is under load.

Fixes #1242

Signed-off-by: Wouter Born <github@maindrain.net>
2021-05-11 19:54:33 +02:00
Wouter Born
91307993ad
Upgrade Units of Measurement dependencies (#2319)
Upgrades UoM dependencies to:

* javax.measure 2.1.2
* si-units 2.0.1
* indriya 2.1.2

An openHAB OSGi-ified si-units bundle is used as runtime dependency, because the latest si-units release is still missing proper OSGi manifest headers.

Notable changes:

* Quantity not longer implements an `equals` method, so the unit tests had to be adjusted. This should have any impact outside of the unit tests though since the rest of openHAB should be using QuantityType instead.
* RationalConverter is not package private, so instances of it much be created through the MultiplyConverter static functions.
* Quantities.getQuantity can no longer parse values without units like `100`. A workaround has been implemented.
* The unicode greek `mu` letter is now returned for unit prefixes instead of the unicode `micro` character. These characters are visually identical but the unit tests had to be adjusted. The new library seems to parse both types just fine.

Also-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com>
Signed-off-by: Wouter Born <github@maindrain.net>
2021-05-10 20:54:25 +02:00
openhab-bot
305683ac6a
New Crowdin updates (#2339)
* New translations restauth.properties (Hebrew)

* New translations addons.properties (Hebrew)

* New translations jsonStorage.properties (Hebrew)

* New translations chart.properties (Hebrew)

* New translations DefaultSystemChannels.properties (Polish)

* New translations LanguageSupport.properties (Polish)

* New translations audio.properties (Polish)

* New translations voice.properties (Polish)

* New translations SystemProfiles.properties (Polish)

* New translations units.properties (Polish)

* New translations validation.properties (Polish)

* New translations validation.properties (Finnish)

* New translations messages.properties (Polish)

* New translations tags.properties (Polish)

* New translations firmware.properties (Polish)

* New translations chart.properties (Polish)

* New translations inbox.properties (Polish)

* New translations ephemeris.properties (Polish)

* New translations restauth.properties (Polish)

* New translations addons.properties (Polish)

* New translations persistence.properties (Polish)

* New translations jsonStorage.properties (Polish)

* New translations network.properties (Polish)

* New translations i18n.properties (Polish)

* New translations jsonStorage.properties (Finnish)

* New translations i18n.properties (Finnish)

* New translations network.properties (Finnish)

* New translations voice.properties (Dutch)

* New translations persistence.properties (Dutch)

* New translations addons.properties (Dutch)

* New translations restauth.properties (Dutch)

* New translations ephemeris.properties (Dutch)

* New translations inbox.properties (Dutch)

* New translations audio.properties (Dutch)

* New translations hli.properties (Dutch)

* New translations brokerConnectionInstance.properties (Dutch)

* New translations lsp.properties (Dutch)

* New translations jsonStorage.properties (Dutch)

* New translations chart.properties (Dutch)

* New translations i18n.properties (Dutch)

* New translations network.properties (Dutch)

* New translations DefaultSystemChannels.properties (Italian)

* New translations audio.properties (Ukrainian)

* New translations inbox.properties (Ukrainian)

* New translations restauth.properties (Ukrainian)

* New translations addons.properties (Ukrainian)

* New translations i18n.properties (Ukrainian)

* New translations network.properties (Ukrainian)

* New translations lsp.properties (Italian)

* New translations lsp.properties (German)

* New translations lsp.properties (Finnish)

* New translations lsp.properties (Hebrew)

* New translations hli.properties (German)

* New translations hli.properties (Finnish)

* New translations hli.properties (Hebrew)

* New translations hli.properties (Italian)

* New translations brokerConnectionInstance.properties (Italian)

* New translations brokerConnectionInstance.properties (Hebrew)

* New translations brokerConnectionInstance.properties (Finnish)

* New translations jsonStorage.properties (German)

* New translations jsonStorage.properties (Spanish)

* New translations network.properties (Spanish)

* New translations tags.properties (Italian)

* New translations voice.properties (Hebrew)

* New translations i18n.properties (Hebrew)

* New translations network.properties (Hebrew)

* New translations jsonStorage.properties (Hebrew)

* New translations chart.properties (Hebrew)

* New translations persistence.properties (Hebrew)

* New translations inbox.properties (Italian)

* New translations jsonStorage.properties (Finnish)

* New translations audio.properties (Finnish)

* New translations inbox.properties (Finnish)

* New translations ephemeris.properties (Finnish)

* New translations restauth.properties (Finnish)

* New translations addons.properties (Finnish)

* New translations persistence.properties (Finnish)

* New translations chart.properties (Finnish)

* New translations addons.properties (Hebrew)

* New translations voice.properties (Finnish)

* New translations i18n.properties (Finnish)

* New translations network.properties (Finnish)

* New translations audio.properties (Hebrew)

* New translations inbox.properties (Hebrew)

* New translations ephemeris.properties (Hebrew)

* New translations restauth.properties (Hebrew)

* New translations audio.properties (Italian)

* New translations ephemeris.properties (Italian)

* New translations restauth.properties (Italian)

* New translations network.properties (Italian)

* New translations addons.properties (Italian)

* New translations persistence.properties (Italian)

* New translations jsonStorage.properties (Italian)

* New translations chart.properties (Italian)

* New translations voice.properties (Italian)

* New translations i18n.properties (Italian)

* New translations i18n.properties (German)

* New translations restauth.properties (German)

* New translations addons.properties (German)

* New translations persistence.properties (German)

* New translations chart.properties (German)

* New translations voice.properties (German)

* New translations network.properties (German)

* New translations inbox.properties (German)

* New translations ephemeris.properties (German)

* New translations audio.properties (German)

* New translations voice.properties (Ukrainian)

* New translations ephemeris.properties (Ukrainian)

* New translations chart.properties (Ukrainian)

* New translations jsonStorage.properties (Ukrainian)

* New translations persistence.properties (Ukrainian)

* New translations voice.properties (German)
2021-05-05 21:09:31 +02:00
Wouter Born
7579aa4d31
Fix more SAT findings and add a few suppressions (#2335)
* Fix more SAT findings and add a few suppressions

Signed-off-by: Wouter Born <github@maindrain.net>
2021-05-05 20:59:59 +02:00
Christoph Weitkamp
31494c0d8a
Added i18n feature for ConfigurableServices (#2333)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-05-05 01:19:23 +02:00
openhab-bot
0972ad5ede
New Crowdin updates (#2336)
* New translations addons.properties (French)
* New translations audio.properties (Hebrew)
* New translations audio.properties (Hungarian)
* New translations chart.properties (Finnish)
* New translations chart.properties (French)
* New translations ephemeris.properties (Hebrew)
* New translations firmware.properties (Finnish)
* New translations i18n.properties (Hebrew)
* New translations inbox.properties (Hebrew)
* New translations jsonStorage.properties (French)
* New translations LanguageSupport.properties (Finnish)
* New translations network.properties (Hebrew)
* New translations persistence.properties (French)
* New translations persistence.properties (Hebrew)
* New translations SystemProfiles.properties (Hebrew)
* New translations tags.properties (Hebrew)
* New translations voice.properties (Hebrew)
2021-05-02 11:40:36 +02:00
openhab-bot
f2bf0a26c9
New Crowdin updates (#2326)
* New translations DefaultSystemChannels.properties (Hebrew)

* New translations addons.properties (German)

* New translations voice.properties (German)

* New translations chart.properties (German)

* New translations persistence.properties (German)

* New translations ephemeris.properties (German)

* New translations inbox.properties (German)

* New translations audio.properties (German)

* New translations DefaultSystemChannels.properties (Portuguese, Brazilian)

* New translations voice.properties (German)

* New translations messages.properties (Ukrainian)

* New translations addons.properties (Ukrainian)

* New translations restauth.properties (Ukrainian)

* New translations ephemeris.properties (Ukrainian)

* New translations inbox.properties (Ukrainian)

* New translations audio.properties (Ukrainian)

* New translations jsonStorage.properties (Ukrainian)

* New translations persistence.properties (Ukrainian)

* New translations chart.properties (Ukrainian)

* New translations i18n.properties (Ukrainian)

* New translations network.properties (Ukrainian)

* New translations audio.properties (Dutch)

* New translations inbox.properties (Dutch)

* New translations ephemeris.properties (Dutch)

* New translations restauth.properties (Dutch)

* New translations addons.properties (Dutch)

* New translations persistence.properties (Dutch)

* New translations chart.properties (Dutch)

* New translations jsonStorage.properties (Dutch)

* New translations voice.properties (Dutch)

* New translations voice.properties (Ukrainian)

* New translations i18n.properties (Dutch)

* New translations network.properties (Dutch)

* New translations persistence.properties (Finnish)

* New translations addons.properties (Finnish)

* New translations ephemeris.properties (Finnish)

* New translations audio.properties (Italian)

* New translations inbox.properties (Italian)

* New translations ephemeris.properties (Italian)

* New translations voice.properties (Italian)

* New translations addons.properties (Italian)

* New translations restauth.properties (Italian)

* New translations firmware.properties (Luxembourgish)

* New translations firmware.properties (Italian)

* New translations messages.properties (Luxembourgish)

* New translations tags.properties (Finnish)

* New translations units.properties (Finnish)

* New translations validation.properties (Italian)

* New translations LanguageSupport.properties (Italian)

* New translations persistence.properties (Italian)

* New translations chart.properties (Italian)

* New translations jsonStorage.properties (Italian)

* New translations network.properties (Italian)

* New translations i18n.properties (Italian)

* New translations i18n.properties (Portuguese, Brazilian)

* New translations network.properties (Portuguese, Brazilian)

* New translations voice.properties (Portuguese, Brazilian)

* New translations chart.properties (Portuguese, Brazilian)

* New translations jsonStorage.properties (Portuguese, Brazilian)

* New translations persistence.properties (Portuguese, Brazilian)

* New translations restauth.properties (Portuguese, Brazilian)

* New translations addons.properties (Portuguese, Brazilian)

* New translations ephemeris.properties (Portuguese, Brazilian)

* New translations inbox.properties (Portuguese, Brazilian)

* New translations audio.properties (Portuguese, Brazilian)

* New translations i18n.properties (German)

* New translations network.properties (German)

* New translations jsonStorage.properties (German)

* New translations restauth.properties (German)
2021-04-30 18:19:50 +02:00
Christoph Weitkamp
93d7973b56
[i18n] Translation of configurable services (#2306)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-04-29 15:20:55 +02:00
Christoph Weitkamp
c9cdf5d0e8
Added i18n propertie files for DefaultSystemChannels and Profiles (#2297)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-04-19 17:06:42 +02:00
Wouter Born
05b7ec86f1
Fix new SAT findings (#2291)
Signed-off-by: Wouter Born <github@maindrain.net>
2021-04-14 18:41:07 +02:00
Sönke Küper
db488d861e
[automation] Added rule rest endpoint and backend operation for rule execution simulation (#2125)
* Added marker interface for TriggerHandler to indicate if they are time based and thus can be used to simulate execution times.
* Added marker interface for ConditionHandler to indicate, if they are time based and thus can be checked during rule execution for a certain time.
* Moved CronAdjuster to common, so it can be used for the rule simulation
* Created RuleExecutionSimulator that allows simulation of rules
* Added method in RuleManger to create simulation
* Added rest endpoint for rule simulation.
* Changed marker interface to return TemporalAdjuster instead of cron expression. This better hides the internals of the TriggerHandler (i.e. the cron expression) and is more clear and flexible for other handlers to implement

Fixes #2044
Fixes #2266

Signed-off-by: Sönke Küper <soenkekueper@gmx.de>
2021-04-11 09:31:48 +02:00
Wouter Born
07b95ca668
Fix SAT findings (#2256)
Fixes 65 SAT findings.

Signed-off-by: Wouter Born <github@maindrain.net>
2021-03-25 20:18:08 +01:00
Christoph Weitkamp
26e9a8ed9c
Added nullness annotations to fix NPE in HttpServiceUtil (#2234)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-03-12 22:12:03 +01:00
Hilbrand Bouwkamp
7fef42c6c8
[scheduler] Mitigation fix for earlier triggers #1976 (#2190)
Some users reported the scheduler to be run to earlier.
It actual is known the Java scheduler can drift.
To handle this problem 2 changes have been made:
1. If the scheduler triggers > 2 sec before expected end time it will
reschedule.
2. The scheduler keeps track of the timestamp the job should run. For
recurring schedulers, like cron, when the next job is run it offsets of
the calculated time, and not the actual time. This guaranties that the
next scheduled time is actual the next scheduled time and not the same
end time in case the scheduler would trigger to early.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
2021-02-27 11:21:10 +01:00
Christoph Weitkamp
7907f48735
Added nullness annotations to TypeParser (#2181)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-02-07 09:47:27 +01:00
Wouter Born
46666eb169
Fix deprecations (#2163)
Signed-off-by: Wouter Born <github@maindrain.net>
2021-01-30 12:22:31 +01:00
pravussum
75f52ac3ee
add getPoolNames method to ThreadPoolManager (#2065)
Signed-off-by: Robert Bach <openhab@mortalsilence.net>
2021-01-05 23:27:35 +01:00
Wouter Born
774b9d607b
Update license headers to 2021 (#2041)
Signed-off-by: Wouter Born <github@maindrain.net>
2021-01-01 16:43:46 +01:00
Kai Kreuzer
a91f8c657b Align all threads to naming convention (#2018)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-28 09:22:13 +01:00
t2000
caaf1c7281
Expire group item states (#2009)
Fixes #1989

Signed-off-by: Stefan Triller <github@stefantriller.de>
2020-12-26 22:53:26 +01:00
Wouter Born
ce95ed191e
Hide StateDescription constructor (#1995)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-12-23 21:43:38 +01:00
Gaël L'hopital
f7e03397fb
[OAuth] Added capability for custom deserializer (#1891)
* Added capability for custom deserializer

Closes #1888

Signed-off-by: clinique <gael@lhopital.org>
2020-12-23 15:40:54 +01:00
Hilbrand Bouwkamp
df2013805b
Fix for invalid day of week max check (#1986)
Closes #1813

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
2020-12-22 20:42:37 +01:00
Wouter Born
bf14e1077f
Apply Spotless, resolve itest runbundles for 3.1.0 (#1982)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-12-22 10:01:42 +01:00
jenkins
965531696b [unleash-maven-plugin] Preparation for next development cycle. 2020-12-20 22:24:39 +00:00
Kai Kreuzer
0dd4cc97fe
Let StartLevelService only start once its configuration is available (#1942)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-16 12:47:03 +01:00
Kai Kreuzer
1a2c81d9e2
Improved startup logging and avoid scripts being loaded in start level service thread (#1919)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-13 09:31:09 +01:00
Kai Kreuzer
076ac3fe15
Implemented start level service (#1914)
Fixes #1637
Fixes #1777
Fixes #1734
Fixes #1823
Fixes #1808

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-12 14:34:37 +01:00
Wouter Born
fea6237153
Improve ChannelLinkNotifier.removed and AbstractUID.getAsString performance (#1909)
Fixes #1908

Signed-off-by: Wouter Born <github@maindrain.net>
2020-12-10 10:20:35 +01:00
Wouter Born
0dabc63423
Update "o.e.sh" references (#1910)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-12-10 10:15:48 +01:00
Markus Rathgeb
406f83cbb6
HexUtils: fix empty string handling (#1907)
Fixes #1903

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
2020-12-09 09:57:39 +01:00
Wouter Born
0abf1aa987
Remove SmartHome leftovers (#1901)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-12-08 12:49:06 +01:00
Wouter Born
13c2d7bf2b
Rename classes with "SmartHome" in their name (#1896)
* Rename SmartHomeUnits to Units
* Rename SmartHome Servlets and HTTP Context

Signed-off-by: Wouter Born <github@maindrain.net>
2020-12-06 23:35:37 +01:00
Kai Kreuzer
c5f133b3e9
[automation] Provide triggering item name in the rule context (#1770)
* introduced implicit variable "triggeringItemName"

Fixes #1768

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-01 20:29:50 +01:00
Kai Kreuzer
f2e1dea5bf
Adapted event handler thread names to naming convention (#1858)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-29 11:12:03 +01:00
silamon
9a12f95dee
Remove the groupname from the members if the group item is removed (#1833)
Remove the groupname from the members if the group item is removed.
This is implemented in the ManagedItemProvider.

Fixes #1785
Fixes #1392

Signed-off-by: Simon Lamon <simonlamon93@hotmail.com>
2020-11-22 12:24:38 +01:00
Christoph Weitkamp
ddaf0d46fd
Added support for MetricPrefix combined with byte and use byte as default instead of octet (#1838)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-19 19:33:10 +01:00
Kai Kreuzer
63ec4342f2
Added expire functionality as core framework feature (#1803)
* Added expire functionality as core framework feature

Closes #1620

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-19 14:15:02 +01:00
Kai Kreuzer
70ca7655a2
Harden item creation by checking for validity of name (#1825)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-18 00:18:00 +01:00
Kai Kreuzer
c2b3885e9e
Do not provide unit information for plain number items (#1811)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-12 22:13:28 +01:00
Wouter Born
2f2bfde500
Remove Map null annotation workarounds (#1780)
These workarounds to prevent false positives can be removed now the EEAs allow for proper null analysis.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-11-03 22:12:22 +01:00
Wouter Born
0281c10036
[infrastructure] add external null-annotations (#1775)
Add EEAs and fix null analysis errors.

Related to:

* #888
* openhab/openhab-addons#8848

Signed-off-by: Wouter Born <github@maindrain.net>
2020-11-03 21:33:48 +01:00
Christoph Weitkamp
a598fa94f4
Fixed provider comparison (#1792)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-03 18:00:28 +01:00
Christoph Weitkamp
5683cc2472
Revert ordering of accepted data types for 'StringItem' (#1776)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-30 15:15:03 +01:00
Christoph Weitkamp
25683471e8
Revert ordering of accepted datatypes for StringItem (#1774)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-29 08:45:21 +01:00
Christoph Weitkamp
172ee2f0ad
Replaced static inline declarations by List.of() method (#1755)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-25 15:20:30 +01:00
Christoph Weitkamp
8744bc10fe
[cache] Added 'ByteArrayFileCache' (#1723)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-25 12:06:30 +01:00
Yannick Schaus
8b52cab5ef
[REST Auth] API tokens & openhab:users console command (#1735)
This adds API tokens as a new credential type. Their format is:
`oh.<name>.<random chars>`

The "oh." prefix is used to tell them apart from a JWT access token,
because they're both used as a Bearer authorization scheme, but there
is no semantic value attached to any of the other parts.

They are stored hashed in the user's profile, and can be listed, added
or removed managed with the new `openhab:users` console command.

Currently the scopes are still not checked, but ultimately they could
be, for instance a scope of e.g. `user admin.items` would mean that the
API token can be used to perform user operations like retrieving info
or sending a command, _and_ managing the items, but nothing else -
even if the user has more permissions because of their role (which
will of course still be checked).

Tokens are normally passed in the Authorization header with the Bearer
scheme, or the X-OPENHAB-TOKEN header, like access tokens.
As a special exception, API tokens can also be used with the Basic
authorization scheme, **even if the allowBasicAuth** option is not
enabled in the "API Security" service, because there's no additional
security risk in allowing that. In that case, the token should be
passed as the username and the password MUST be empty.

In short, this means that all these curl commands will work:
- `curl -H 'Authorization: Bearer <token>' http://localhost:8080/rest/inbox`
- `curl -H 'X-OPENHAB-TOKEN: <token>' http://localhost:8080/rest/inbox`
- `curl -u '<token>[:]' http://localhost:8080/rest/inbox`
- `curl http://<token>@localhost:8080/rest/inbox`

2 REST API operations were adding to the AuthResource, to allow
authenticated users to list their tokens or remove (revoke) one.
Self-service for creating a token or changing the password is more
sensitive so these should be handled with a servlet and pages devoid
of any JavaScript instead of REST API calls, therefore for now they'll
have to be done with the console.

This also fixes regressions introduced with #1713 - the operations
annotated with @RolesAllowed({ Role.USER }) only were not authorized
for administrators anymore.

* Generate a unique salt for each token

Reusing the password salt is bad practice, and changing the
password changes the salt as well which makes all tokens
invalid.

Put the salt in the same field as the hash (concatenated
with a separator) to avoid modifying the JSON DB schema.

* Fix API token authentication, make scope available to security context

The X-OPENHAB-TOKEN header now has priority over the Authorization
header to credentials, if both are set.

* Add self-service pages to change password & create new API token

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-25 12:04:40 +01:00
Wouter Born
4c31c0b3ff
Fix issues with configuration PIDs (#1727)
* Fixes warnings about "using different service PIDs"
* Fixes missing default values

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-18 18:02:13 +02:00
Wouter Born
3d88e91952
Open ProviderTracker asynchronously when activating AbstractRegistry (#1719)
* Open ProviderTracker asynchronously when activating AbstractRegistry

Fixes #890

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-18 00:31:13 +02:00
Kai Kreuzer
70fed5a9c2
Fixed initialization of group items with aggregation functions (#1718)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-10-15 23:03:22 +02:00
Kai Kreuzer
e9ffff9f01
Fixed name of measurement systems (#1717)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-10-14 22:46:55 +02:00
Christoph Weitkamp
fc65deca01
Reduced logging level to warn (#1657)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-09-19 16:00:37 +02:00
Kai Kreuzer
fa18610d77
[core] Make logger in QuantityType transient (#1652)
This makes QuantityType serialisable

Fixes #1651

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-09-19 09:57:42 +02:00
Christoph Weitkamp
eab9be1410
Removed deprecated constructors and methods from Thing API (#1414)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-09-13 13:53:12 +02:00
Wouter Born
6018348d04
Remove deprecated NetUtil methods (#1622)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-06 22:55:05 +02:00
Kai Kreuzer
9070539a1a
Improved add-on installation logic (#1617)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-09-03 12:13:25 +02:00
Wouter Born
057604cc2d
Use new Collection API methods (#1598)
Using the new methods there will be less and more readable code.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-22 23:04:11 +02:00
Wouter Born
d5529f0c1b
Fix various deprecations (#1595)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-15 10:54:41 +02:00
Wouter Born
7300734585
Use "openhab" event topic prefix (#1587)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-11 21:16:49 +02:00
Wouter Born
d3ea6063c0
Migrate to JUnit 5 (#1580)
* Migrates all tests to the JUnit 5 Jupiter API
* Updates bnd to 5.1.2
* Updates maven-surefire-plugin to 3.0.0-M5
* Updates Mockito to 3.4.6
* Updates Hamcrest to 2.2
* Removes org.openhab.core.boot POM dependencies

Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-09 14:36:46 +02:00
Wouter Born
df780f8467
Fix QuantityType.format timezone bug (#1575)
* Fix QuantityType.format timezone bug

Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-01 13:03:01 +02:00
Kai Kreuzer
0f134996f2
removed boot bundle (#1559)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-07-24 13:11:56 +02:00
Paul Vogel
ed21001891
Cleanup tests: Simplify assertEquals with boolean to assertTrue or assertFalse (#1567)
Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-23 22:19:00 +02:00
Kai Kreuzer
8218f44667
[cleanup] refactored Extension to Addon (#1560)
* refactored Extension to Addon

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-07-22 21:08:10 +02:00
Paul Vogel
27dcce5207
Replace for-loops and iterators with foreach-loops (#1561)
Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-21 17:40:29 +02:00
Paul Vogel
a00cc871a9
Replace c-style array declaration with java-style array declaration (#1556)
Replaces the way an array is declared with the way "prefered for java", because the [] is part of the TYPE and not the NAME.

Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-20 18:31:03 +02:00
Paul Vogel
d21d9b64e6
Remove unnecessary conversion to string (#1557)
We can remove the explicit conversion to the string, as this is done implicitly.

Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-20 18:29:27 +02:00
Christoph Weitkamp
72c2ee78d1
Moved 'parseState()' method into 'GroupFunctionHelper' and apply only if needed (#1534)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-09 23:25:15 +02:00
Hilbrand Bouwkamp
6c935985a6
Fix for cron scheduler handling sunday as number (#1533)
* Fix for cron scheduler handling sunday as number

Closes #1532

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
2020-06-26 17:18:57 +02:00
Christoph Weitkamp
115b3e22f3
Use 'ZoneId.systemDefault()' instead of 'TimeZone.getDefault().toZoneId()' (#1527)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-06-21 14:34:40 +02:00
Christoph Weitkamp
6deb3255ea
Apply TimeFormat for labels of Number:Time items (#1470)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-06-18 22:25:10 +02:00
Christoph Weitkamp
68405036f1
Removed 'Calendar' leftovers (#1522)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-06-14 17:13:28 +02:00
Kai Kreuzer
173c93081d
Replaced "classic" rule engine by a DSLRuleProvider for the NGRE (#1451)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-06-14 10:36:25 +02:00
Christoph Weitkamp
1fddac192b
Removed deprecated contructors and methods (#1500)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-06-13 21:01:06 +02:00
Hilbrand Bouwkamp
e84d01bafe
[core] Fix for handling inverted cron ranges (#1519)
* Fix for handling inverted cron ranges

This fix adds support for inverted cron ranged. For example SUN-WEN.
It also works all ranges and also with additional increments.

Closes #1516

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
2020-06-09 12:32:26 +02:00
Christoph Weitkamp
370feb5404
Added few unit tests! (#1518)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-06-08 21:26:49 +02:00
Kai Kreuzer
d265e16e67
[automation] Added group and system triggers to automation component (#1509)
* Added group and system triggers to automation component

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-06-04 07:24:42 +02:00
Chris Jackson
795a19249c
Ensure managed provider is unset by registered provider (#1506)
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
2020-06-01 01:28:25 +02:00
Christoph Weitkamp
907da5064c
Removed unused InstanceCreator implementation (#1502)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-05-27 17:25:03 +02:00
Wouter Born
02b13f5263
Update maven-javadoc-plugin to 3.2.0 (#1494)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-23 17:35:13 +02:00
Wouter Born
f3508e4775
Use constructor injection and update null annotations (#1487)
* Use constructor injection and update null annotations

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-20 17:29:18 +02:00
Christoph Weitkamp
178ffdf9c2
Removed some ESH leftovers (#1468)
* Removed ESH leftovers

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-05-11 08:41:12 +02:00
Wouter Born
61e17ce39e
Upgrade SAT and Spotless, apply Spotless and enable check (#1446)
* Update SAT and Spotless dependencies
* Apply Spotless and enable check

Signed-off-by: Wouter Born <github@maindrain.net>
2020-04-26 11:15:24 +02:00
Wouter Born
ed4b5ff94b
Reconfigure and apply Spotless (#1442)
Adds a configuration for feature.xml files which will be necessary for https://github.com/openhab/static-code-analysis/pull/375

Also applies the results of running Spotless

Signed-off-by: Wouter Born <github@maindrain.net>
2020-04-23 17:17:12 +02:00
Christoph Weitkamp
d371a34321
Removed dependency on 'org.apache.commons.lang' (#1433)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-04-22 14:32:31 +02:00
Christoph Weitkamp
6b4e54ada3
Removed deprecated 'newItemBuilder' method (#1429)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-04-19 14:51:21 +02:00
Wouter Born
92027ca922
Use .equals() on constants and literals to prevent NPEs (#1420)
* Use .equals() on constants and literals to prevent NPEs

Signed-off-by: Wouter Born <github@maindrain.net>
2020-04-16 07:40:49 +02:00
Wouter Born
6c85b1bccd
Add and fix more null annotations (#1421)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-04-15 01:44:37 +02:00
Christoph Weitkamp
b770bb1b4a
Removed 'StateDescriptionProvider' interface (#1413)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-04-14 21:15:29 +02:00
Wouter Born
fb7a7ac421
Add null annotations to providers and ThingManager (#1412)
* Add null annotations to providers and ThingManager

Signed-off-by: Wouter Born <github@maindrain.net>
2020-04-11 08:29:12 +02:00
J-N-K
70b9355d08
[uom] Fix concurrency issue in state update (#1406)
* Fix concurrency issue in state update

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
2020-04-08 19:54:13 +02:00
Wouter Born
945afcdb1a
Add and fix more null annotations (#1407)
* Add and fix more null annotations
* Add more @NonNullByDefault and @Nullable annotations
* Remove unnecessary @NonNull annotations
* Fix a few other trivial SAT issues
* Add constructor injection for MDNSDiscoveryService

Signed-off-by: Wouter Born <github@maindrain.net>
2020-04-06 10:45:39 +02:00
Christoph Weitkamp
1981e548aa
[thing] Dynamic state/command provider should not return original description (#1399)
* Clarify return values for implementation
* Dynamic state/command provider should not return original descritpion
* Added ERROR log message
* Added integration test for CommandDescriptionProvider

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-04-06 08:49:26 +02:00
Christoph Weitkamp
3cb26ee28a
[storage] Improved JavaDoc (#1409)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-04-06 08:48:20 +02:00
Christoph Weitkamp
259af7aaef
Fix java.lang.UnsupportedOperationException in StateDescriptionFragmentBuilder (#1405)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-04-05 17:53:48 +02:00
Yannick Schaus
fe4e276b68
Implementation of a JWT-based OAuth2 flow for the admin API (#1389)
* Initial implementation of a JWT-based OAuth2 flow for the admin API

Implements #1388.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-03-23 22:36:11 +01:00
Christoph Weitkamp
a06eb598d7
[uom] Fixed intensity conversion from W/m² to µW/cm² (#1394)
* Fixed intensity conversion from W/m² to µW/cm²

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-03-22 12:03:01 +01:00
Kai Kreuzer
0182ce567d
fixed service pids (#1382)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-03-01 16:40:01 +01:00
Christoph Weitkamp
4258d87d4a
Small improvements for SmartHomeUnits (#1377)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-02-25 19:48:48 +01:00
pali
b15145a078
Added Bq/m³ and ppb units (#1368)
Signed-off-by: Pauli Anttila <pauli.anttila@gmail.com>
2020-02-17 08:50:19 +01:00
Yannick Schaus
60e040c529
Metadata-based state & command description providers (#1362)
* Metadata-based state & command description providers

Implements #1185.

These providers will look into item metadata, which
can be managed by UIs with the API, to set or override
the item's state description (pattern, options, read
only...) or command description.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-02-15 18:08:42 +01:00
Yannick Schaus
eea31e536d
UI component registries initial implementation (#1356)
* UI component registries initial implementation

This is an initial implementation of #1355.
It was simple enough to make to be proposed as
a PR already without waiting for remarks on the RFC.

The SitemapProvider for the `system:sitemap`
namespace as described in #1355 is not part of
this PR.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-02-13 21:36:54 +01:00
Christoph Weitkamp
79523d3a99
Removed usage of org.apache.commons.lang.ArrayUtils (#1357)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-02-07 13:42:18 +01:00
Nagy Attila Gábor
487db7e7ea
Added and fixed units for reactive and apparent power (#1347)
* var and varh were missing
* var is basically an alternate form of WATT
* kvarh was incorrectly marked as a division between kvar and hour
* Volt-Ampere added to the units

This unit for apparent power in an electrical circuit. Useful for smart meters and solar inverters.

Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
2020-02-01 21:47:19 +01:00
Christoph Weitkamp
28afe7d866 Remove not needed object array creation for logging (#1344)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-27 09:22:17 +01:00
Christoph Weitkamp
ac537c53d9 Added public method to remove all members from a group (#1283)
* Added public method to remove all members from a group
* Spelling in itest method names
* File encoding

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-26 12:54:37 +01:00
Kai Kreuzer
32c1978a1a Added hashCode and equals method to StringListType to fix object comparison (#1341)
* Added hashCode and equals method to StringListType to fix object comparison

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-01-25 20:35:24 +01:00
Christoph Weitkamp
2c8de49231 Applied spotless formatter (#1335)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-19 14:40:09 +01:00
Christoph Weitkamp
08da8de5cf Moved "ESH-INF/" folders to "OH-INF/" folders (#1328)
* Moved ESH-INF folders to OH-INF folders

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-17 15:29:18 +01:00
Wouter Born
18d0a52d02 Switch to Java 11 and drop Java 8 support (#1305)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-01-12 22:32:28 +01:00
Christoph Weitkamp
7d42607e4c Streamline format of event outputs (#1318)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-09 12:40:25 +01:00
Markkuuss
a8232e4b1c Correction of unit spellings Ampere hour (#1316)
Signed-off-by: Markus Schraufstetter <markus.schraufstetter@gmail.com>
2020-01-05 12:20:35 +01:00
Christoph Weitkamp
84009652a8 Changed configurationPid prefixes from 'org.openhab.core' ot 'org.openhab' (#1314)
* Changed configurationPid prefixes from 'org.openhab.core' ot 'org.openhab'

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-02 09:12:34 +01:00
Wouter Born
3811cb9560 Update copyright headers to 2020 (#1309)
* Update copyright headers to 2020

Signed-off-by: Wouter Born <github@maindrain.net>
2020-01-01 18:06:34 +01:00
Gaël L'hopital
1c1bde0ef7 Add Ampere hour (A h) and electrolytic conductivity (µS/cm) units (#1308)
* Adressing issues #1295 and #1296

Fixes #1295
Fixes #1296

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
2019-12-31 11:31:44 +01:00
Christoph Weitkamp
800956598b Applied spotless formatter (#1302)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-30 22:55:19 +01:00
Christoph Weitkamp
dd4368e23f Added nullness annotations; Some minor improvements; Unit tests for 'ItemCommandEvent' on group (#1299)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-28 22:25:07 +01:00
Christoph Weitkamp
59675788e0 Renamed packages
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-28 12:18:16 +01:00
Christoph Weitkamp
fca7c215a5 Moved files to new location
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-28 12:18:16 +01:00
Christoph Weitkamp
be89210019 Fixed link in JavaDoc (#1289)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-21 18:41:32 +01:00
Christoph Weitkamp
7130988901 Added missing JavaDoc to 'createGroupStateChangedEvent' method (#1276)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-18 23:04:09 +01:00
Christoph Weitkamp
f32d779894 Simplify lifecycle by using constructor injection (#1278)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-18 23:02:56 +01:00
jenkins
bc6a380297 [unleash-maven-plugin] Preparation for next development cycle. 2019-12-15 14:55:36 +00:00
Gaël L'hopital
b9105bde38 Correcting Issue #1231 (#1240)
Forgot to test decimal negatives

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
2019-11-25 23:21:44 +01:00
Christoph Weitkamp
abb558851f Removed duplicate brackets (#1235)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-22 09:38:48 +01:00
Wouter Born
403b55c8fc Parameterized logging fixes (#1213)
Make sure Throwables are not be substituted into log messages so they can be formatted according to the logging configuration.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-11-14 20:08:06 +01:00
Christoph Weitkamp
d77d8b763e Added check for invalid duration (#1209)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-13 18:35:42 +01:00
Christoph Weitkamp
8c4fb060ed Minor clean-ups in 'SmartHomeUnits', 'SIUnits' and 'ImperialUnits' (#1208)
* Minor clean-us in SmartHomeUnits
* Clean-up in 'SIUnits' and 'ImperialUnits'

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-13 18:35:17 +01:00
Gaël L'hopital
694ff49954 Issue #1157 Enhance DecimalType to accept epoch seconds and milliseconds. (#1158)
* Issue 1157 Enhance DecimalType to accept epoch seconds and milliseconds.

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
2019-11-10 21:45:38 +01:00
Christoph Weitkamp
9ba4f55bb5 Added unit test for 'CommandDescriptionBuilder' (#1181)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-03 19:16:43 +01:00
Wouter Born
f002a21da5 Fix SAT errors/warnings in resources and tests (#1178)
Fixes SAT errors/warnings in resources and tests reported by SAT 0.8.0-SNAPSHOT.

Related to openhab/static-code-analysis#363

Signed-off-by: Wouter Born <github@maindrain.net>
2019-11-03 11:04:19 +01:00
Christoph Weitkamp
2f86782c9d Added 'InstaceCreator' for 'PersistedItem' (#1173)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-01 16:28:53 +01:00
Christoph Weitkamp
8351a2f8d4 [binding] Added nullness annotations (#1165)
* Added nullness annotations to o.o.c.binding.xml
* Use local variables
* Removed unuused import

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-28 08:14:10 +01:00
Wouter Born
2430256b6a Add null annotations to registries (#1134)
Adds null annotations to all registries, the interfaces they implement and a few other classes.

Also-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-23 07:36:56 +02:00
Christoph Weitkamp
09170d1b43 Fixed cron parsing for Day-Of-Week sub-expression (#1159)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-22 22:29:31 +02:00
Wouter Born
be69d2254e Use !isEmpty() instead of "size() > 0" or "size() != 0" (#1155)
* Use !isEmpty() instead of "size() > 0" or "size() != 0"

!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.

Co-Authored-By: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-21 09:00:52 +02:00
Christoph Weitkamp
21744d22b1 Normalized instantiation of loggers (#1138)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-18 22:29:27 +02:00
Christoph Weitkamp
0fdd691c22 Removed superflous resources (#1137)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-18 22:28:37 +02:00
Christoph Weitkamp
91617d8af8 Fixed POM XML Shema Definition path (#1119)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-12 08:52:16 +02:00
Christoph Weitkamp
73d55a9fe9 Changed pid from 'org.eclipse.smarthome.core.i18nprovider' to 'org.eclipse.smarthome.i18n' (#1112)
* Changed pid from 'org.eclipse.smarthome.core.i18nprovider' to 'org.eclipse.smarthome.i18n'

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-11 19:50:04 +02:00
Wouter Born
12e8edc039 Use diamond operator (#1114)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-11 02:29:47 -07:00
Wouter Born
4e10e0d116 Fix SAT JavadocMethodStyleCheck findings (#1109)
* Fix SAT JavadocMethodStyleCheck findings

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-10 14:18:54 +02:00
Wouter Born
3d52c72a91 Fix SAT AuthorContributionDescriptionCheck findings (#1110)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-10 11:36:05 +02:00
Wouter Born
90005e4a56 Fix NoEmptyLineSeparatorCheck and NewlineAtEndOfFileCheck SAT findings (#1108)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-08 22:19:54 -07:00
Wouter Born
08a1f9a86d Fix SAT constant/variable name findings (#1106)
Fixes wrong names identified by the following rules:

* ConstantNameCheck
* LocalFinalVariableNameCheck
* LocalVariableNameCheck
* StaticVariableNameCheck

Most mismatches identified by the MemberNameCheck have also been fixed except for those where the variables are used in events/DTOs etc which would cause issues.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-08 22:19:00 -07:00
Wouter Born
12b3c1030f Fix SAT "Initial contribution" warnings (#1100)
Fixes the SAT warning: First javadoc author should have "Initial contribution" contribution description.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-07 21:25:40 -07:00
Wouter Born
3dacba3510 Fix SAT ModifierOrderCheck findings by using JLS suggested modifier order (#1103)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-07 21:24:16 -07:00
Christoph Weitkamp
c31a5aa7ef [storage] Added nullness annotations (#1099)
* Added nullness annotations

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-07 20:50:39 +02:00
Wouter Born
7926b2280e Move core unit tests (#1070)
* Move core unit tests

Moves the core unit tests from the itests project to the bundle project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 19:51:53 +02:00
Hilbrand Bouwkamp
2f7689e0a7 [OAuth2] redirectURI should be optional on getAccessTokenResponseByAu… (#1073)
* [OAuth2] redirectURI should be optional on getAccessTokenResponseByAuthorizationCode

The redirectURI should be optional (Nullable) on getAccessTokenResponseByAuthorizationCode as in the JavaDoc is stated (as is stated in the refered specification).

* [OAuth2] Removed redundant NonNull

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
2019-10-03 10:27:20 +02:00
Wouter Born
c9232d9651 Inject SchedulerImpl into DelegatedSchedulerImpl to fix waiting bundles (#1054)
Fixes #1053

Signed-off-by: Wouter Born <github@maindrain.net>
2019-09-29 16:47:19 +02:00
lolodomo
7b49f27823 Fix dynamic options in UI (#1050)
* Fix dynamic options in UI
* Added unit tests

Fixes #1040

Also-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2019-09-28 21:02:29 +02:00
Christoph Weitkamp
b9d9135771 Use constructor injection to simplify lifecycle (#1037)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-09-27 12:19:50 +02:00
Wouter Born
8509a94cfd Fix DateTimeType parsing of strings with arbitrary number of nano digits (#1039)
* Fix DateTimeType parsing of strings with 2 nano digits

Some formatters such as the DateTimeFormatter.ISO_LOCAL_DATE_TIME may also output a string containing 2 nano digits which fail to be parsed by DateTimeValue.

* Fix parsing of arbitrary number of nano digits for Java 11

Signed-off-by: Wouter Born <github@maindrain.net>
2019-09-18 13:24:41 +02:00
Christoph Weitkamp
cd57f1d79c Refactoring of builders (#908)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-09-16 21:10:39 +02:00
Christoph Weitkamp
b3802d565d [infrastructure] bump SAT to 0.7.0 (#1007)
* Bump SAT version; Fixed high priority findings
* Defined path to feature file to avoid warnings

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-08-29 09:17:35 +02:00
Christoph Weitkamp
7d4b21f4d9 Fix gamma correction in HSBType (#996)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-08-28 22:24:16 +02:00
Christoph Weitkamp
5c5c9ae126 Specified OSGi service (#989)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-08-24 23:47:44 +02:00
Christoph Weitkamp
be1cd25743 [itemregistry] Use constructor injection to simplify lifecycle (#988)
* Use constructor injection to simplify lifecycle

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>

* PR extended by ItemStateConverter

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-08-23 18:21:28 +02:00
Stewart Cossey
f51bd640f3 Fix incorrect unit symbol for Byte and add unit symbol for Octet. (#990)
Signed-off-by: Stewart Cossey <stewart.cossey@gmail.com>
2019-08-21 20:34:08 +02:00
Wouter Born
9d2f09936d Fix null annotations order and cleanup (#958)
* Move null annotations between modifiers and variable type
* Remove redundant public modifiers from interfaces where applicable
* Remove redundant `@NonNull` annotations

Signed-off-by: Wouter Born <github@maindrain.net>
2019-08-08 09:42:30 +02:00
lolodomo
f03f328bf0 DateTimeType: new methods toZone and toLocaleZone (#945)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2019-08-02 13:57:39 +03:00
Christoph Weitkamp
95e0190d55 Avoid multiple type castings (#946)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-07-28 11:32:15 +02:00
Christoph Weitkamp
c95dfcb1cc Added formatting tests for DateTimeType (#938)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-07-22 21:56:22 +02:00