Commit Graph

1007 Commits (581c1a81a94f9f0ee6e3f5d3ea93483bc91be070)

Author SHA1 Message Date
Christoph Weitkamp 19daef5d09
Harden ChartServlet against NPEs when no 'period' parameter is given ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-23 12:57:27 +01:00
Christoph Weitkamp 0af74400d2
Added nullness annotations to ThingHandlerHelper ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-23 12:56:15 +01:00
Hilbrand Bouwkamp df2013805b
Fix for invalid day of week max check ()
Closes 

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
2020-12-22 20:42:37 +01:00
Christoph Weitkamp 7ce96ac06a
Fixed NPE in ScriptError if INode is empty ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-22 20:34:49 +01:00
Wouter Born bf14e1077f
Apply Spotless, resolve itest runbundles for 3.1.0 ()
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
Christoph Weitkamp f83fc07c6a
[automation] Added ItemStateUpdate action ()
* Added ItemUpdate action

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-20 13:53:09 +01:00
Holger Hees 7f3de9ae02
fix spelling of german tag synonyms () 2020-12-20 13:50:24 +01:00
Yannick Schaus 150ced7012
[auth] Don't allow creating API tokens with no name ()
Fixes https://github.com/openhab/openhab-webui/issues/674.

Remove unnecessary checks and fix exception message.
Add Norwegian messages for auth pages.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-12-20 12:48:46 +01:00
Kai Kreuzer cea96b3d81
[automation] Do not consider disabled things for start level 80 ()
Fixes 

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-20 09:44:45 +01:00
Philipp Waller 090b889dbb
[REST] Fix CORS response header to allow preflight requests with authorization payload ()
Signed-off-by: Philipp Waller <1090452+philippwaller@users.noreply.github.com>
2020-12-19 13:11:46 +01:00
Kai Kreuzer 8f13b99122
[automation] Correctly trigger rules with start level 50 trigger ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-18 22:07:19 +01:00
Kai Kreuzer 4a108e5c80
Reintroduce delayed rule initialization ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-18 20:04:28 +01:00
Yannick Schaus cc7edadd96
Auth messages translations (RC2) ()
This contains an update to the messages for the login,
change password, create API token pages from Crowdin
in ISO-8859 format.

Contains a completed German translation update, and
the following new completed languages:
- Czech
- Finnish
- Hungarian
- Portuguese (Brazil)
- Swedish
- Ukrainian

Dutch, French, Italian are unchanged from RC1.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-12-17 20:37:15 +01:00
Kai Kreuzer 69b18e5a70
Introduce ready marker to correctly set start level 80 ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-17 11:16:56 +01:00
Kai Kreuzer 5d87c1def4
[automation] Fixed startup rules being triggered more than once
Fixes  

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-16 23:21:47 +01:00
Christoph Weitkamp d37fa48da4
Temporarily hide ThingAction in UIs ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-16 23:21:27 +01:00
Kai Kreuzer 4059ea2422
[automation] Correctly return the evaluation result of DSL scripts
Fixes 

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-16 23:20:37 +01:00
Christoph Weitkamp 397ebaab64
Fixed NPE by not calling 'toString()' ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-16 18:59:28 +01:00
Kai Kreuzer ad189bd4f1
[automation] Make quantity types available in scripts ()
Fixes 

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-16 15:11:46 +01:00
Kai Kreuzer 2b9f890831
Stabelized automation integration test ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-16 14:13:04 +01:00
Kai Kreuzer 0dd4cc97fe
Let StartLevelService only start once its configuration is available ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-16 12:47:03 +01:00
Christoph Weitkamp 990b579865
Use 'getStateAs()' instead of type casting ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-15 23:03:03 +01:00
lolodomo 5bf3f2fd60
[inbox REST API] Fix approve API annotation ()
Related to 

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2020-12-15 21:17:41 +01:00
Yannick Schaus 128e7bb3c8
Add firmwareStatus to things in summary mode ()
The "summary" mode for `/rest/things` introduced in https://github.com/openhab/openhab-core/pull/1827
leads to these warnings in the console:
```
Field 'firmwareStatus' could not be eliminated: Can not set final org.openhab.core.thing.firmware.dto.FirmwareStatusDTO field org.openhab.core.io.rest.core.thing.EnrichedThingDTO.firmwareStatus to null value
```
The easiest solution to remove those warnings is to add it again to the list of fields included in the summaries.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-12-15 08:07:11 +01:00
Yannick Schaus eb176e14d2
Translated messages for auth pages ()
This is the PR with the messages.properties files in
Dutch, German (partial) and Italian extracted from
 and converted to the proper ISO-8859 encoding.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-12-13 21:09:13 +01:00
Kai Kreuzer 8290306348
Fixed SAT issues ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-13 13:17:35 +01:00
Wouter Born 001c00a8c3
Fix remaining deprecations ()
Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-12-13 12:22:43 +01:00
Kai Kreuzer ec6ac00742
increase the rule refresher delay ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-13 11:05:23 +01:00
Kai Kreuzer 0a719cca83
Always set the value of implicit vars ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-13 09:32:25 +01:00
Kai Kreuzer 313fb496ce
Added config options for start level trigger ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-13 09:31:34 +01:00
Kai Kreuzer 1a2c81d9e2
Improved startup logging and avoid scripts being loaded in start level service thread ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-13 09:31:09 +01:00
openhab-bot 91469ddb9b
New Crowdin updates ()
* New translations units.properties (Portuguese, Brazilian)
* New translations firmware.properties (Portuguese, Brazilian)
* New translations validation.properties (Portuguese, Brazilian)
2020-12-12 23:29:54 +01:00
Yannick Schaus 67bdfa3ad6
Auth pages i18n ()
This implements localized messages for the authorize, change
password and create API token pages using a resource bundle.

Messages in English & French are included.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-12-12 22:42:56 +01:00
Christoph Weitkamp e909a81f4b
Removed references to not existing category ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-12 22:35:20 +01:00
Christoph Weitkamp 3293bac779
Register CommunicationManager as ItemChannelLink listener ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-12 21:55:37 +01:00
Kai Kreuzer 076ac3fe15
Implemented start level service ()
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-12 14:34:37 +01:00
Christoph Hofmann bbede78dc9
Added operationIds for OpenAPI specification ()
Signed-off-by: Christoph Hofmann <christoph@hofmann.pm>
2020-12-10 23:12:11 +01:00
Christoph Weitkamp fe677966af
[link] Use constructor injection ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-10 23:07:56 +01:00
Wouter Born fea6237153
Improve ChannelLinkNotifier.removed and AbstractUID.getAsString performance ()
Fixes 

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

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
2020-12-09 09:57:39 +01:00
silamon 2f5a6269c2
[semantics] Remove semantic metadata on item tag removal ()
* Remove semantic update on tag removal

Fixes 

Signed-off-by: Simon Lamon <simonlamon93@hotmail.com>
2020-12-08 17:12:14 +01:00
Kai Kreuzer e075df30f8
Moved modbus transport from addons to core ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-08 12:55:52 +01:00
Wouter Born 0abf1aa987
Remove SmartHome leftovers ()
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 ()
* 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 f99135ae3d
Reverted the introduction of an automation threadpool ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-05 11:50:16 +01:00
silamon 34a3487e3e
Disable AutoUpdateManager for GroupItems ()
* Disable AutoUpdateManager for GroupItems

Fixes  

Signed-off-by: Simon Lamon <simonlamon93@hotmail.com>
2020-12-03 17:20:59 +01:00
Kai Kreuzer 85fcb7b141
Cache safe call proxies for profiles instead of continuously recreating them ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-03 09:28:07 +01:00
Wouter Born 6e0a5d0260
Improve tags_nl.properties ()
* Fix wrong Location_Indoor_Floor_SecondFloor translation
* Remove redundant whitespace chars

Signed-off-by: Wouter Born <github@maindrain.net>
2020-12-03 08:37:55 +01:00
lolodomo 5ae3c675c6
[semantics] Property Illuminance removed ()
Related to 

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2020-12-02 20:29:18 +01:00
Christoph Weitkamp 0e7563c901
[automation] Added Actions for Play and Say which sets the volume ()
* Added Actions for Play and Say which sets the volume

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-01 22:57:43 +01:00
Kai Kreuzer c5f133b3e9
[automation] Provide triggering item name in the rule context ()
* introduced implicit variable "triggeringItemName"

Fixes 

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-01 20:29:50 +01:00
Christoph Weitkamp cd0654806b
Fixed config description ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-01 08:39:52 +01:00
Christoph Weitkamp 818a7c82fa
Get only relevant links instead of all ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-30 19:31:18 +01:00
Kai Kreuzer a892c7bcac
Synchronize the executions of each rule ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-30 10:31:33 +01:00
Markus Rathgeb c044061dc4
fix null constraint mismatch in model.thing for generic thing provider ()
The type 'Thing' is not a valid substitute for the type parameter '@NonNull E extends Object'

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
2020-11-30 10:27:40 +01:00
Markus Rathgeb 0eaf58f047
fix null type mismatch in model.thing generic thing provider ()
required '@NonNull URI' but this expression has type '@Nullable URI'

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
2020-11-30 10:27:16 +01:00
Markus Rathgeb 7885aa3526
fix null type in model.thing generic item channel link provider ()
required '@NonNull Collection<?>' but this expression has type '@Nullable Set<@NonNull String>'

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
2020-11-30 10:26:56 +01:00
Kai Kreuzer 575f744a43
Request automation thread pool as a scheduled pool ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-30 10:18:56 +01:00
Marcel aa317d8c85
Fix typo in TriggerChannelTypeBuilder ()
Signed-off-by: Marcel Verpaalen marcel@verpaalen.com
2020-11-29 23:07:57 +01:00
Kai Kreuzer f2e1dea5bf
Adapted event handler thread names to naming convention ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-29 11:12:03 +01:00
Kai Kreuzer fe62a4fdae
Make maps thread safe ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-29 11:02:00 +01:00
Kai Kreuzer 1e2fd7b447
Make rule engine use a threadpool ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-29 10:56:01 +01:00
Christoph Weitkamp 109fae9974
[profiles] Added 'Hysteresis' profile ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-29 00:21:43 +01:00
Jonathan Gilbert e8d017da77
Extracted accessor into interface and added to script engine context to allow access to script extensions from script engine factories ()
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
2020-11-28 23:24:19 +01:00
Kai Kreuzer 9e89a4dbda
[magic] Added a trigger channel for easier tests ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-27 15:02:04 +01:00
lolodomo f6d3f1d560
[semantics] Ontology enhanced ()
Related to 

Also-by: Christoph Weitkamp <github@christophweitkamp.de>
Also-by: Mark <m.stroeve@appsoftware.nl>
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2020-11-26 15:01:33 +01:00
lolodomo b40d10a978
[inbox REST API] Added new optional pareameter newThingId to approve ()
Fix 

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2020-11-26 08:37:16 +01:00
Yannick Schaus 6ff65df7d2
[REST Auth] Remove user access to things ()
I can't think of a good reason why listing things or querying their status should be allowed for users.
The things layer should only be of concern to admins IMHO.
As noted here: https://community.openhab.org/t/oh3-will-list-all-your-things-even-if-you-are-not-logged-in/108006/3
passwords and other sensible information in configuration could end up being exposed without auth required.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-26 08:31:10 +01:00
silamon 9a12f95dee
Remove the groupname from the members if the group item is removed ()
Remove the groupname from the members if the group item is removed.
This is implemented in the ManagedItemProvider.

Fixes 
Fixes 

Signed-off-by: Simon Lamon <simonlamon93@hotmail.com>
2020-11-22 12:24:38 +01:00
Jonathan Gilbert 60edebc111
Pass script context to script engines ()
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
2020-11-22 10:52:22 +01:00
Yannick Schaus 065177b730
[rest] Add summary option to rules, things, UI components resources ()
The /things, /rules, /ui/components endpoints retrieve all objects
in their entirety, which can become very big, i.e. channels, config
parameters, script rule modules or trees of UI components can
quickly add up to the size.

When the UI simply displays a list of those objects it retrieves all
this extra information but does nothing with it.

This introduces an optional ?summary=true query parameter for the
above resources to limit the output to pre-defined fields which are
deemed most relevant for displaying these lists, omitting the rest.

When the option is not set, the behavior remains unchanged so this
change is not API breaking. The API version has therefore not been
incremented. The client is responsible for adding the option to
retrieve summarized collections instead of the entire objects.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-21 18:40:48 +01:00
Kai Kreuzer 5330de0473
Avoid potential NPE ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-19 20:13:23 +01:00
Christoph Weitkamp ddaf0d46fd
Added support for MetricPrefix combined with byte and use byte as default instead of octet ()
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 ()
* Added expire functionality as core framework feature

Closes 

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 ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-18 00:18:00 +01:00
Wouter Born d5e7fe3ab3
Update LastNPE EEAs to 2.2.1 ()
Signed-off-by: Wouter Born <github@maindrain.net>
2020-11-17 16:29:09 +01:00
Kai Kreuzer 94d6a80493
Create separate DSLScriptEngine instances for every handler ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-14 20:16:19 +01:00
silamon d59d3c3cc2
[REST] Apply metadata selector regex on all namespaces ()
* Change metadata selector

Fixes 

Signed-off-by: Simon Lamon <simonlamon93@hotmail.com>
2020-11-14 17:58:46 +01:00
Yannick Schaus 4e045204ac
[automation] Create Nashorn script engines with the proper class loader ()
This should fix the issue reported here:
https://community.openhab.org/t/openhab-3-0-milestone-2-discussion/107564/8

where the Nashorn script engine would be created with the
current thread's class loader, causing JS code like this:
```
var Log = Java.type("org.openhab.core.model.script.actions.Log");
Log.logError("Experiments", "This is an OH error log");
Log.logWarn("Experiments", "This is an OH warn log");
Log.logInfo("Experiments", "This is an OH info log");
Log.logDebug("Experiments", "This is an OH debug log");
```
to run fine when the rule was triggered but fail to find the Log
class when run from the REST API's `/rest/rules/{ruleUID}/runnow`,
because in that case the generic createScriptEngine implementation
would return script engines using the JAX-RS class loader as the
"app" class loader.

Note:
We also have an opportunity to restrict which classes are exposed
to the script with a ClassFilter to a specific set:
https://docs.oracle.com/javase/8/docs/jdk/api/nashorn/jdk/nashorn/api/scripting/NashornScriptEngineFactory.html#getScriptEngine-java.lang.String:A-java.lang.ClassLoader-jdk.nashorn.api.scripting.ClassFilter-
This could prove useful to mitigate code execution vulnerabilities,
as the script code is modifiable remotely.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-11-14 15:17:33 +01:00
Christoph Weitkamp 7cb746ece1
Changed comparison from equals() to reference ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-14 13:46:03 +01:00
lolodomo 8102cffb7f
Log reason for rules/scripts refresh ()
* Log reason for rules/scripts refresh

Fixes 

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2020-11-13 21:38:35 +01:00
Kai Kreuzer 7d2a505e13
[automation] Correctly map the state context variable of the ItemStateEvent to the implicit var newState ()
Fixes  

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-13 07:29:56 +01:00
Kai Kreuzer c2b3885e9e
Do not provide unit information for plain number items ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-12 22:13:28 +01:00
Kai Kreuzer 48209e4a45
[automation] Fixes NPE when no command is given in a member-of-group trigger ()
Fixes  

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-11 16:27:31 +01:00
Christoph Weitkamp 53af3c99ad
Allow max, min and avg calculations on other types ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-10 22:40:55 +01:00
Sonic-Amiga 3b65a9c556
transport/mqtt: Introduce setUnsubscribeOnStop() function ()
Some MQTT servers can be quirky, then do not handle Usubscribe request properly.
In this case we have to omit sending it. Introduce a boolean flag, telling
whether the request should be sent or not, and add a public function to set it.

iRobot built-in MQTT server is known to suffer from this problem.

Signed-off-by: Pavel Fedin <pavel_fedin@mail.ru>
2020-11-10 22:37:46 +01:00
Christoph Weitkamp 0b239692ce
Added NPE checks for result of 'getSymbolicName()' methods ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-10 22:36:21 +01:00
Christoph Weitkamp 91e16e0f80
Print 'ItemChannelLink' configuration in output of console commands ()
* Print ItemChannelLink configuration in output of console commands

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-05 09:22:01 +01:00
Wouter Born 2f2bfde500
Remove Map null annotation workarounds ()
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 ()
Add EEAs and fix null analysis errors.

Related to:

* 
* 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-11-03 21:33:48 +01:00
Christoph Weitkamp a598fa94f4
Fixed provider comparison ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-03 18:00:28 +01:00
Kai Kreuzer 35b0a1275e
[charts] Add support for QuantityTypes to DefaultChartProvider ()
Fixes 

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-02 10:45:31 +01:00
Kai Kreuzer 5a9c5e7d87
strip unit from historic states ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-01 01:53:02 +01:00
Christoph Weitkamp 5683cc2472
Revert ordering of accepted data types for 'StringItem' ()
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 ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-29 08:45:21 +01:00
radicale ae26ce4618
Fixed typo in class name TrustAllTrustMananger. Will probably require changes in bindings as well. ()
Signed-off-by: Alessandro Radicati <radicale@gmail.com>
2020-10-28 20:42:45 +01:00
Kai Kreuzer 749b8f17fe
[automation] Allow dashes in rule file names ()
* Allow dashes in rule file names

Fixes 

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-10-25 20:19:00 +01:00
Yannick Schaus 3df4403268
[REST Auth] Clear session cookie only when deleting own session ()
Fix https://github.com/openhab/openhab-webui/issues/441

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-25 19:52:12 +01:00
Christoph Weitkamp 172ee2f0ad
Replaced static inline declarations by List.of() method ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-25 15:20:30 +01:00
Christoph Weitkamp acdbdfa4d7
[ui] Added unit test for read-only Number- and String-Items to not return a Selection Element ()
* Added unit test for read-only Number- and String-Items to not return a Selection Element
* Improved usage of 'lastIndexOf'

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-25 12:11:17 +01:00
Christoph Weitkamp 8744bc10fe
[cache] Added 'ByteArrayFileCache' ()
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 ()
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  - 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
Christoph Weitkamp dd92288e97
Added nullness annotations, ctor injection ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-24 10:08:38 +02:00
Christoph Weitkamp 5d75bce553
Sort audio sinks ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-21 23:56:44 +02:00
Wouter Born 584c85a07f
[automation] Improve rule debugging ()
* Add rule UID to error message
* Add exception with stacktrace when debug level is enabled

Related to 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-20 15:50:25 +02:00
Yannick Schaus d262b6f5bc
Add missing roles checks ()
(I included these fixes in  but extracted them in a stanalone
PR because it's easier to review and a little more urgent.)

As a result of the refactoring in , the operations annotated with
`@RolesAllowed` containing `Role.USER` are not anymore automatically
considered accessible to all users, regardless of their actual roles.

4 operations are therefore now denied to admins if they only have the
`Role.ADMIN` role, as the first admininistrator is created only with
that role the UI encounters unexpected access denied errors and breaks.
(See https://github.com/openhab/openhab-webui/issues/422).

Closes https://github.com/openhab/openhab-webui/issues/422.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-20 08:20:39 +02:00
Wouter Born 0ac14b9f8f
Fix IAE when enabling debug logging on PersistenceManagerImpl ()
Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-19 22:47:28 +02:00
Christoph Weitkamp 7d70a97b77
Fixed IndexOutOfBoundsException in ScriptModuleTypeProvider ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-19 13:41:58 +02:00
Wouter Born b2c045d0fe
Fix build by wrapping lines ()
Caused by 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-19 11:42:26 +02:00
Yannick Schaus e26c49b9bf
Allow basic authentication to authorize API access ()
* Allow basic authentication to authorize API access

Closes .

Note, this opens a minor security issue that allows an attacker
to brute force passwords by making calls to the API - contrary to
the authorization page, the credentials parsing for the REST API
is stateless & doesn't have a lock mechanism to lock user accounts
after too many failed login attempts.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-18 20:59:51 +02:00
Wouter Born 4c31c0b3ff
Fix issues with configuration PIDs ()
* 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 ()
* Open ProviderTracker asynchronously when activating AbstractRegistry

Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-18 00:31:13 +02:00
Christoph Weitkamp 4ba70778d1
Added validation for relation between ThingUID and BridgeUID ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-17 17:59:34 +02:00
Wouter Born 605c1c238c
Add Automation extension type ()
Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-17 15:08:53 +02:00
Kai Kreuzer 5d830d64f0
Fixed missing item resolution of DSL scripts created through the UI ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-10-15 23:04:30 +02:00
Kai Kreuzer 70fed5a9c2
Fixed initialization of group items with aggregation functions ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-10-15 23:03:22 +02:00
Kai Kreuzer e9ffff9f01
Fixed name of measurement systems ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-10-14 22:46:55 +02:00
Wouter Born 0d1a15ef34
Update ActionService and ThingActions classes in Xtext cache ()
Xtext uses a cache for looking up classes when rules are run.
It also adds a null class value to this cache when a class is not found.

Once a value has entered the cache it will not be updated.
This causes the cache to return the wrong class (or the null value) when
calling static methods on ActionService and ThingActions classes that
were added/updated.

With the changes in this PR Xtext will be configured to use a custom cache
that updates the ActionService and ThingActions class references.

The PR also has a fix for the AnnotatedThingActionModuleTypeProvider not
properly sending ModuleType removed events when all ThingActions
registrations have been removed.

Fixes 
Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-13 23:17:57 +02:00
Wouter Born 7d8126e89f
Fix ScriptEngine parameter option removal ()
When one of the engines is unset the ScriptModuleTypeProvider clears all parameter options instead of only those that apply to that engine.
This fixes the Nashorn engine missing from the parameter options on the first openHAB startup.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-13 23:13:30 +02:00
Connor Petty a29490a545
Fix and cleanup logging in ExecUtil ()
* Fix and cleanup logging in ExecUtil

Signed-off-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com>
2020-10-11 22:19:42 +02:00
Wouter Born ab1fa65aa1
Improve JwtHelper exception handling ()
Catch specific exceptions and don't log errors but instead add an appropriate message and preserve the stacktrace.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-11 10:03:39 +02:00
Kai Kreuzer 351fcb1852
Include measurement system in REST root resource ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-10-10 20:04:25 +02:00
Wouter Born 159aefffa5
Remove unused DBus Transport ()
Related to 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-10 08:08:22 +02:00
Connor Petty 0dfda1e7f6
Make ExecUtil more robust ()
Signed-off-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com>
2020-10-08 18:38:04 +02:00
Christoph Weitkamp c4b76a0ad1
Added action for 'isBankHoliday(<file>)' ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-07 22:03:15 +02:00
Wouter Born 1edf25b4f9
Prevent IllegalStateException when closing SSE sink ()
* Prevent IllegalStateException when closing SSE sink
* Simplify code and log exceptions on debug

There seem to be no issues anymore with the exception handling when SSE clients disconnect so simplify the exception handling.
Suppressing exceptions based on error message is also likely to break when new exceptions are added or messages change.
There are also still exceptions that get logged with "failure" but from which the code seems to recover without any issues.

Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-07 20:20:52 +02:00
Wouter Born 44b1823e97
Fix two typos ()
Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-05 09:03:27 +02:00
Yannick Schaus b7a764f358
Remove actions from available add-on types ()
Since there are no more action add-ons in the distribution, I'd suggest to remove these from the `KarafAddonService` so they won't appear in the UI menus.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-10-04 22:38:42 +02:00
Wouter Born d1629e50f3
Upgrade to XStream 1.4.13 ()
* Fixes bugs (vulnerabilities/performance issues)
* Supports OSGi better
* Prevents illegal reflective access warnings on newer Java versions
* Supports java.time converters

For XStream release notes see: https://x-stream.github.io/changes.html

The XmlDocumentReader which uses XStream has also been modified to configure XStream security to prevent "Security framework of XStream not initialized, XStream is probably vulnerable" warnings.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-04 19:56:44 +02:00
Wouter Born abd2630777
Upgrade Xtext/Xtend to 2.23.0 and LSP 0.9.0 ()
Upgrades to:

* Xtext 2.23.0
* Xtend 2.23.0
* LSP 0.9.0

For Xtext release notes see: https://www.eclipse.org/Xtext/releasenotes.html#/releasenotes/2020/09/01/version-2-23-0

The Xtext dependencies are now managed using their BOM which makes it easier to keep them in sync.

Because Xtext depends on a newer ASM version some runtime dependencies were also upgraded:

* ASM 8.0.1
* Pax Web 7.2.15
* XBean 4.17.0

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-04 12:27:58 +02:00
Wouter Born 3b16f2ce7c
Filter empty i18n config parameter options ()
* Filter empty i18n config parameter options

There are many locales that do not have a country resulting in these empty parameter options.

Related to 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-02 14:25:52 +02:00
Wouter Born b62d494bf0
Sort Ephemeris config parameter options ()
Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-02 08:19:02 +02:00
Wouter Born 9739271b52
Fix sitemap subscription cleanup ()
* Add listener to SseBroadcaster so sseEventSinkRemoved events are handled
* Use Instant instead of long for tracking subscription creation times
* Run cleanup every 2 minutes instead of every 5 minutes

Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-02 08:11:31 +02:00
Wouter Born 369e678a63
Remove remaining deprecated MQTT transport code ()
This removes the remaining deprecated MQTT transport code which was not part of .

Related to 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-24 19:36:11 +02:00
Wouter Born 245a692705
Remove deprecated MQTT transport code ()
Related to 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-24 14:57:01 +02:00
Wouter Born 6b97328189
Fix ConfigurableService deprecations ()
Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-24 14:55:50 +02:00
Wouter Born c5541a0391
Remove deprecated handleUpdate from ThingHandler ()
The handleUpdate method was deprecated when profiles were introduced (see eclipse-archived/smarthome#4108).
Instead the "follow profile" can be used which forwards item updates as commands to handlers.
This profile works with any binding instead of only those that implement the handleUpdate method.

Related to 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-24 14:53:33 +02:00
Wouter Born 2dd1a03abd
Fix item channel links not properly initialized ()
* Fix item channel links not properly initialized
* Add ChannelLinkNotifierOSGiTest
* Send at most one channelLinked event per linked thing channel when activating ChannelLinkNotifier
* Send channelUnlinked event only if all items are unlinked
* Use Registry stream instead of getAll

Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-24 08:41:05 +02:00
Wouter Born d33598ae54
Remove deprecated default methods ()
Removes:

* ConfigOptionProvider.getParameterOptions(URI, String, Locale) (see also )
* DiscoveryListener.removeOlderResults(DiscoveryService, long, Collection<ThingTypeUID>)

Related to 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-23 19:06:29 +02:00
Wouter Born f845772ab0
Remove deprecated BaseThingHandler.initialize() ()
Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-23 13:33:05 +02:00
Wouter Born fb83864eb9
Fix transformation file path with locale specific files ()
The path is incorrect because a bug was introduced in .
This results in the MapTransformationServiceTest failing so it was disabled in .

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-22 08:20:11 +02:00
Wouter Born fabf6808ec
Remove deprecated ConfigConstants ()
Related to 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-21 22:57:23 +02:00
Wouter Born 979e80ee9e
Fix callback not added to new PageChangeListener ()
Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-20 14:28:06 +02:00
Christoph Weitkamp fc65deca01
Reduced logging level to warn ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-09-19 16:00:37 +02:00
HoLLe 5ab248c158
[REST API] fixed small typo () 2020-09-19 13:02:56 +02:00
Kai Kreuzer fa18610d77
[core] Make logger in QuantityType transient ()
This makes QuantityType serialisable

Fixes 

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-09-19 09:57:42 +02:00
Wouter Born 5919f923d5
Increase StartlevelEvent delay to 15 seconds ()
The rules are often not instantiated within 5 seconds.
On a Raspberry Pi 3B it can take 12 seconds before rules are instantiated.
The code has also been improved with proper null annotations.

Related to 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-18 23:27:56 +02:00
Wouter Born f201b83c09
Fix "Unable to watch transformation directory" warnings ()
Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-18 08:54:23 +02:00
Wouter Born 81e82e7d44
Use consistent capitalization with Conditions, Triggers, Actions ()
Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-15 19:52:35 +02:00
Wouter Born f5f1e32b9f
Add null annotations to ConfigDescriptionRegistry and ConfigUtil ()
Also added "org.eclipse.jdt.annotation" to the test BOM so we can use "org.eclipse.jdt.annotation.Checks" in itests.
That class has many useful methods that help with writing more readable test code when using the Eclipse JDT null analysis annotations.

After running the resolver on the itests  a lot of bundles were removed from the itest.bndrun files.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-15 17:00:15 +02:00
Kai Kreuzer 57d4487f36
Removed ChannelItemProvider ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-09-14 09:21:55 +02:00
Christoph Weitkamp eab9be1410
Removed deprecated constructors and methods from Thing API ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-09-13 13:53:12 +02:00
Yannick Schaus 426bd112b7
[REST/Auth] Always accept tokens in the alt header ()
Currently the AuthFilter will try to find a token in the
X-OPENHAB-TOKEN HTTP header - only when it finds a cookie
named X-OPENHAB-AUTH-HEADER. It can cause problems because
browsers or proxies might block the cookie from being sent
for various reasons (for instance if there's a path set
for it).

There is no downside IMHO to always try to fallback to
checking the X-OPENHAB-TOKEN header for a token, if and
only if it's not already provided in the Authorization
header. It is the responsibility of the client to decide
how it wants to authorize the request among the available
options - by checking a cookie, or something else entirely.

Also removed the '?api_key=' option because Swagger UI
doesn't provide tokens that way anymore.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-09-09 20:48:10 +02:00
Wouter Born b3880ebe88
Remove deprecated methods from Configuration, UID and ThingHelper ()
Removes the following deprecated methods:

* org.openhab.core.config.core.Configuration.get​(Object)
* org.openhab.core.config.core.Configuration.remove​(Object)
* org.openhab.core.thing.UID.getSegments()
* org.openhab.core.thing.util.ThingHelper.ensureUnique​(Collection<Channel>)

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-09 09:22:27 +02:00
Paul Vogel 695647c7f6
Removes the incorrect use of the encoding header in each JSON response ()
The ResponseBuilder's "encoding()" function sets the http header "Content-Encoding", which is used to compress the media type and not to specify the character encoding.

Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-09-08 12:00:54 +02:00
Wouter Born ab8aa9ed3a
FeatureInstaller improvements ()
* Use Streams for filtering, mapping and checking predicates
* Add exception to warnings/errors when debug logging is enabled
* Use final featuresService field so method arguments can be removed

Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-07 19:45:33 +02:00
Wouter Born 2273f8976f
Fix potential NPE in ProfileCallbackImpl ()
Also annotates ItemChannelLink.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-07 15:13:06 +02:00
Wouter Born 02404b2fa7
Fix null analysis errors/warnings ()
The changes in  caused null analysis errors in CommunicationManager.createCallback and caused unnecessary null check warnings in ProfileCallbackImpl.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-07 12:12:31 +02:00
Kai Kreuzer b5fd603eed
cleaned up some null handling ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-09-07 10:45:15 +02:00
Wouter Born 6018348d04
Remove deprecated NetUtil methods ()
Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-06 22:55:05 +02:00
Wouter Born aee47e6381
Remove deprecated FilterCriteria methods ()
Also removes "Zoned" from the getters so they follow the naming of the setters.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-06 22:44:40 +02:00
Christoph Weitkamp f7c8505d7a
Added missing nullness annotations to discovery events ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-09-04 09:07:54 +02:00
Christoph Weitkamp 72a5afadce
[discovery] Added warning if 'representationProperty' is missing in keys of 'properties' map for 'DiscoveryResult' ()
* Added warning if representationProperty is missing in properties map

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-09-04 09:00:21 +02:00
Christoph Weitkamp bee8206853
Migrated tests to JUnit 5 ()
* Migrated tests to JUnit 5

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-09-04 08:23:00 +02:00
Christoph Weitkamp 7eb6d39ae0
[discovery] Added validation for relation between ThingUID and BridgeUID ()
* Added validation for relation between ThingUID and BridgeUID

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-09-03 20:38:07 +02:00
Christoph Weitkamp 6ae1ece83d
[persistence] Added methods to calculate variance and standard deviation for persisted items ()
* Added methods to calculate variance and standard deviation for persisted items

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-09-03 20:35:56 +02:00
Łukasz Dywicki 7652d04ff6 Remove dependencies which are not present in the project. ()
These cause build to fail with clean repository.

Signed-off-by: Łukasz Dywicki <luke@code-house.org>
2020-09-03 20:33:32 +02:00
Kai Kreuzer 9070539a1a
Improved add-on installation logic ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-09-03 12:13:25 +02:00
Christoph Weitkamp a87318aace
Added missing nullness annotations in profile implementations ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-08-30 14:02:23 +02:00
Wouter Born 12a5d08691
Allow property value to be updated to null ()
With the changes in  the BaseThingHandler could no longer update property values to null.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-26 12:06:53 +02:00
Kai Kreuzer f069994ab7
added further system information to rest resources ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-25 00:41:17 +02:00
pacive 184366a1a5
Use TypeParser in ProfileCallbackImpl#sendUpdate for StringType state ()
* Use TypeParser in ProfileCallbackImpl#sendUpdate for StringType state

Signed-off-by: Anders Alfredsson <andersb86@gmail.com>
2020-08-24 23:49:19 +02:00
Kai Kreuzer bcee357829
[rest] added systeminfo rest resource ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-23 10:48:03 +02:00
Kai Kreuzer 3ada0d0148
cleaned up some remainders ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-23 10:40:04 +02:00
Kai Kreuzer b06d466774
ensure that DSLScriptContextProvider is injected whenever available ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-22 23:12:38 +02:00
Wouter Born 057604cc2d
Use new Collection API methods ()
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
pacive 0173e23759
Fix tests failing on windows ()
* Fix tests failing on windows

Signed-off-by: Anders Alfredsson <andersb86@gmail.com>
2020-08-22 23:03:06 +02:00
Kai Kreuzer 0de7ed3f49
fixed reading master volume on macOS ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-22 22:13:36 +02:00
Kai Kreuzer d426d3b8f1
fixed m3u and pls audio stream support ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-22 22:12:45 +02:00
Kai Kreuzer c0ad2a4011
[audio] ported audio sinks from addons to core ()
Also-by: Wouter Born <github@maindrain.net>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-22 08:10:37 +02:00
Yannick Schaus e1771c3b74
Add dark mode support in authorize page ()
Closes https://github.com/openhab/openhab-webui/issues/309.
This only honors the scheme as reported by the `prefers-color-scheme` CSS media feature, i.e. local overrides for the main UI are not taken into account.
Tweak submit button styles to mimic the main UI's desktop theme.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-08-21 11:13:49 +02:00
Wouter Born d5529f0c1b
Fix various deprecations ()
Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-15 10:54:41 +02:00
Kai Kreuzer 545608dab3
registered static methods as extensions ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-14 16:54:55 +02:00
Kai Kreuzer 8c83b60044
fixed item links in rest api ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-14 12:37:40 +02:00
Kai Kreuzer b7193a0acb
re-added log action to script scope and cleaned up imported extensions ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-14 10:06:42 +02:00
Kai Kreuzer 3c83e8a8eb
switched PersistenceExtensions to ZonedDateTime ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-12 21:59:55 +02:00
Wouter Born 7300734585
Use "openhab" event topic prefix ()
Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-11 21:16:49 +02:00
Wouter Born 86b02c26be
Use "openhab" console scope ()
Fixes 

Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-11 20:38:24 +02:00
Kai Kreuzer bab473016c
reduced log levels of ExecUtil ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-11 17:42:44 +02:00
Wouter Born d3ea6063c0
Migrate to JUnit 5 ()
* 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 29dfb967c4
Migrate to OpenAPI 3 annotations ()
* Upgrade to Swagger 2.1.0
* Add missing root and events resources
* Fix wrong and add missing response implementations

Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-02 13:21:57 +02:00
Wouter Born df780f8467
Fix QuantityType.format timezone bug ()
* Fix QuantityType.format timezone bug

Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-01 13:03:01 +02:00
Christoph Weitkamp 419c927587
Enhanced JavaDoc for ChannelBuilder ()
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-29 18:14:54 +02:00
Yannick Schaus 0d635ce970
REST: add runtime info to root resource response ()
This adds basic information about the runtime in the response
to the root `/rest` API resource, mostly for display purposes
by UIs: the version, build string and the location of the
configuration and user data folders.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-07-25 18:18:07 +02:00
Yannick Schaus aac4ca2f79
Swagger: support injection of ReaderListener, add OAuth2 annotations ()
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-07-24 22:30:06 +02:00
Kai Kreuzer 0f134996f2
removed boot bundle ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-07-24 13:11:56 +02:00
Kai Kreuzer e228d490d8
Made swagger visible in the RootResource (/rest) ()
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-07-24 10:23:48 +02:00
Paul Vogel ed21001891
Cleanup tests: Simplify assertEquals with boolean to assertTrue or assertFalse ()
Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-23 22:19:00 +02:00