Commit Graph

1831 Commits

Author SHA1 Message Date
lolodomo
379287690e
[voice] New console commands to list the voice services (#2822)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2022-03-07 13:15:46 +01:00
Wouter Born
f664d756c7
Correct GHA build step condition (#2818)
Fixes that the wrong build step was made conditional in #2817.
It should conditionally add annotations.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-03-06 09:19:26 +01:00
Wouter Born
a54ef35adc
Add Java 17 to GHA CI build matrix (#2817)
This adds Java 17 to the GitHub Actions CI build matrix so we can make sure the build keeps working with both Java 11 and Java 17.
It also updates the required Java version range used by the enforcer plugin so it is also possible to build with the supported Java versions.
Furthermore it prevents duplicate error annotations being added by only adding these in the Java 11 matrix build.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-03-05 17:24:10 +01:00
Wouter Born
44f9baff18
Upgrade Xtext/Xtend to 2.26.0, LSP4J to 0.12.0 (#2786)
For release notes, see:

https://www.eclipse.org/Xtext/releasenotes.html#/releasenotes/2022/02/28/version-2-26-0

This release adds initial support for Java 17.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-03-05 11:28:56 +01:00
dalgwen
7f2edc6f93
[Voice] fix checklocale with RuleHumanLanguageInterpreter (#2813)
Check for  emptyness and not for null. No service returns null.
But RuleHumanLanguageInterpreter returns an empty set to tell it has no locale preference.

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
2022-03-03 15:55:48 +01:00
GiviMAD
b4a5cd331a
[Voice] Fix "best match" format resolution and language check for services involved in dialog (#2809)
Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
2022-02-28 09:10:41 +01:00
Wouter Born
738149d44b
Remove unused local variable (#2807)
Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-27 11:10:41 +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
J-N-K
c267e8f876
Fix missing feature (#2804)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-26 12:51:56 +01:00
J-N-K
0ba4de3594
Fix deadlock when removing ScriptEngine (#2785)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-26 10:29:38 +01:00
J-N-K
013e317b6b
Log the remote address of failed login attempts (#2800)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-26 10:00:00 +01:00
GiviMAD
b57a8c3beb
[Voice] restore getBestMatch method (#2802)
Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
2022-02-26 09:32:06 +01:00
J-N-K
7c3f49ab42
Fix proxy can't handle requests with forwarded host list (#2799)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-25 18:20:50 +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
openhab-bot
03d8489ddd
New Crowdin updates (#2783)
* New translations validation.properties (Czech)

* New translations voice.properties (Czech)

* New translations SystemThingStatusInfos.properties (Czech)
2022-02-24 21:22:02 +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
J-N-K
e420cf1647
Make ConfigDescription for thing and channels available to ThingHandler (#2773)
* Make ConfigDescription for thing and channels available to ThingHandler

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-24 21:18:55 +01:00
GiviMAD
534be1d3ad
[Voice] get audio format refactor (#2795)
Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
2022-02-23 22:17:00 +01:00
lolodomo
c0b5f09c2b
[rule] New actions to start/stop dialog processing (#2791)
* [rule] New actions to start/stop dialog processing

Related to #2688

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2022-02-23 22:15:30 +01:00
J-N-K
192e4a2347
Add a profile for linking trigger channels to String items (#2769)
* Add a profile for linking trigger channels to String items

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-23 21:17:11 +01:00
James Melville
e94de3f860
Rename Thing status variables to be more explicit (#2796)
Signed-off-by: James Melville <jamesmelville@gmail.com>
2022-02-23 21:09:46 +01:00
lolodomo
473198f964
[audio] Add missing method getSource with sourceId as parameter (#2792)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2022-02-20 20:45:12 +01:00
Wouter Born
2e0b242099
Fix rules stay uninitialized when using Java 17 (#2787)
On Java 17 there is no Nashorn scripting engine so it takes a bit longer before ScriptEngines are available.
Rules would stay uninitialized forever because the ScriptModuleTypeProvider did not notify its listeners whenever script.ScriptAction, script.ScriptCondition became available.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-20 20:42:32 +01:00
Wouter Born
5e33cfc26a
Fix test failures when building with Java 17 (#2788)
* Adds some --add-opens to maven-surefire-plugin for:
  * modbus transport tests (java.net)
  * tests using Gson/XStream (java.util)
* Only run ScriptScopeOSGiTest when Nashorn is available as it has been removed since JDK 15

Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-20 20:40:10 +01:00
Christoph Weitkamp
355c1345ea
[rest] Improve metadata query parameter description (#2790)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2022-02-20 17:48:01 +01:00
lolodomo
79ec0396b3
[voice] Check that the provided locale is supported by KS/STT/HLI services (#2789)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2022-02-20 15:47:28 +01:00
GiviMAD
417098e1ad
[DialogProcessor] fix race condition (#2761)
Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
2022-02-20 14:35:41 +01:00
Wouter Born
c300410fd9
Support multi bundle bindings in i18n-maven-plugin (#2748)
* Support multi bundle bindings in i18n-maven-plugin

The plugin did not generate translations for bundles of bindings that do not have a binding.xml file.
With this change it should also be possible to generate the default translations of the modbus and mqtt bindings.

Related to openhab/openhab-addons#12220

Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-20 11:57:18 +01:00
Christoph Weitkamp
7997e2636a
Prevent errors in log when client closes the HTTP connection (#2781)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2022-02-20 11:18:32 +01:00
GiviMAD
0e0adcbb8f
[DialogProcessor] update say method nullability (#2780)
Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
2022-02-19 14:01:41 +01:00
Wouter Born
f411561b70
Flush old JsonStorage to file before recreating a new one (#2778)
Fixes #2774

Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-17 21:41:41 +01:00
J-N-K
dd537c21cb
Fix dispose is called on handlers for disabled things (#2762)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-17 21:36:03 +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
Christoph Weitkamp
9bf181bf0a
Fixed config validation message for parameter options (#2777)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2022-02-17 20:33:37 +01:00
J-N-K
69069270a9
Fix context being re-used for next execution (#2760)
Trigger information is inserted in the execution context. This information is changed to the new information each time the context is updated with the same keys. If the context of the next execution does not contain values for each key, the old key is re-used, leading e.g. to wrong event information in the context.

The solution is to re-set the individual context after each execution.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-17 20:32:58 +01:00
Christoph Weitkamp
44da7a4e0e
Avoid URISyntaxException in tests (#2770)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2022-02-15 17:33:59 +01:00
Wouter Born
69c63703c3
Stop catching Throwables in DefaultMetricsRegistration (#2767)
Looks like this workaround introduced in #2480 is unnecessary nowadays because #2484 addressed the root cause.
This fixes the AvoidCatchingThrowable SAT findings.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-15 16:38:10 +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
J-N-K
8f5d703ceb
Improve log message for invalid configuration updates by handler (#2766)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-15 12:31:18 +01:00
Wouter Born
3d7be0ffa7
Avoid throwing raw exception types (#2747)
* Avoid throwing raw exception types

This fixes all 36 AvoidThrowingRawExceptionTypes SAT findings.

Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-14 16:14:25 +01:00
Wouter Born
ad936cd83f
Add more null annotations (#2742)
* Add more null annotations
* Fix mock name

Adds null annotations to most of the tests as well as a few other classes.
Also fixes a few other SAT findings.
Fixes ~300 SAT findings in total.


Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-14 11:33:50 +01:00
Wouter Born
b5bf0b0157
Always run OSGi HTTP service on random port in itests (#2759)
It is probably always a good idea to run the OSGi HTTP service on a random available port in itests.
This fixes some stacktraces when running itests and it will also prevent future issues when tests using the HTTP service are written.

These stacktraces often show when running itests in parallel:

```
org.ops4j.pax.web.pax-web-runtime [org.ops4j.pax.web.service.internal.HttpServiceStarted] ERROR : Could not start the servlet context for context path []
java.io.IOException: Failed to bind to /0.0.0.0:8080
	at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349)
	at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:310)
	at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
	at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:234)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
	at org.eclipse.jetty.server.Server.doStart(Server.java:401)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
	at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:350)
	at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:255)
	at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:226)
	at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:210)
	at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:69)
	at org.openhab.core.io.http.servlet.BaseOpenHABServlet.activate(BaseOpenHABServlet.java:56)
	at org.openhab.core.io.http.servlet.OpenHABServlet.activate(OpenHABServlet.java:40)
...
```

Similar to: openhab/openhab-addons#11523

Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-14 08:09:55 +01:00
lolodomo
999dab5fb2
[voice] New REST API to start/stop dialog processing (#2731)
Related to #2688

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2022-02-13 20:44:17 +01:00
James Melville
805f223fa9
Add triggeringThing name to DSL rules (#2756)
* Add triggeringThing name to DSL rules
* Include previous and new statuses

Signed-off-by: James Melville <jamesmelville@gmail.com>
2022-02-13 10:34:08 +01:00
James Melville
b594d0a8b7
Add new Imperial Pressure unit psi (#2758)
Signed-off-by: James Melville <jamesmelville@gmail.com>
2022-02-13 10:02:37 +01:00
James Melville
92679aa6fd
Add bearingTo method for PointType (#2757)
Signed-off-by: James Melville <jamesmelville@gmail.com>
2022-02-13 10:01:21 +01:00
J-N-K
9a9217eab8
Expose three classes used as bindings in JSR-223 rules as interfaces (#2723)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-13 09:57:22 +01:00
J-N-K
c0b033b95c
Fix WatchQueueReader cancelling jobs too early (#2745)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-02-12 10:10:23 +01:00