Commit Graph

1179 Commits

Author SHA1 Message Date
spacemanspiff2007
4964b51160
Add cache for Basic Authentication (#2101)
Also-by: Sebastian Gerber <github@sgerber.de>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-03-30 22:55:26 +02:00
Kai Kreuzer
6568dc1478
Merged semantics packages in order to make API consistent (#2263)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-03-30 20:35:06 +02:00
Wouter Born
b64c84e8b9
Fix wrong/missing OpenAPI ApiResponse content (#2258)
This fixes some issues where the response content is missing or wrong in the generated OpenAPI spec.

Signed-off-by: Wouter Born <github@maindrain.net>
2021-03-27 13:28:47 +01:00
Jonathan Gilbert
6961db74d0
[automation] Correctly unload script before reload. (#2254)
- Correctly unload script before reload.

Fixes #2246

Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
2021-03-26 09:48:55 +01:00
Wouter Born
db11cfda51
Add null annotations to org.openhab.core.voice (#2255)
Allows for using null annotations with the voice TTS add-ons.

Signed-off-by: Wouter Born <github@maindrain.net>
2021-03-25 20:19:11 +01: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
Kai Kreuzer
ee1d3f3a73
Removed outdated basic auth classes (#2245)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-03-20 12:46:30 +01:00
Wouter Born
4bf156ffc0
Upgrade Gson to 2.8.6 (#2244)
* Upgrade Gson to 2.8.6

Upgrades Gson from 2.8.2 to 2.8.6.

See change log: https://github.com/google/gson/blob/master/CHANGELOG.md#version-286

Signed-off-by: Wouter Born <github@maindrain.net>
2021-03-17 19:18:17 +01:00
Björn Brings
c2498f5c74
Sort members of groups by labe in sitemaps (#2123)
* Sort group members by label 

Signed-off-by: bjoernbrings <bjoernbrings@web.de>
2021-03-16 15:13:51 +01:00
Jonathan Gilbert
115d39ff35
Removed Jetbrains @NonNull annotations (#2241)
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
2021-03-15 00:15:21 +01:00
Jonathan Gilbert
635b700c72
[automation] Added optional per-script StartLevels (#2222)
Allows scripts to specify per-script start levels which differ from the start level for the ScriptFileWatcher itself. Also extracted some functionality from ScriptFileWatcher into distinct components & added unit tests to cover all script loading functionality.

Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
2021-03-14 22:30:12 +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
Arjan Mels
e20348e8d6
[channel] Fix createChannelBuilders not using overriden label/description (#2229)
* Use channelDefinition in createChannelBuilder

Closes #2225 

Signed-off-by: Arjan Mels <github@mels.email>
2021-03-12 17:54:05 +01:00
Christoph Weitkamp
11c59ccc87
Audiosink might be null (#2224)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-03-06 16:49:44 +01:00
Kai Kreuzer
62c74da0c0 Applied spotless fix
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-03-02 21:38:34 +01:00
boc-tothefuture
89796e79c0
Provide Script Names to Script Engines (#1885)
Signed-off-by: Brian O'Connell <broconne@gmail.com>
2021-03-02 21:36:07 +01:00
stedon81
361e985c1c
io transport mqtt sets wrong QoS levels to hiveMQ #2145 (#2208)
Signed-off-by: Stefan Donath <donath.stefan@mail.donath-productions.ipactive.de>
2021-02-27 11:25:33 +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
191a629e68
Added Sematics actions for Rules (#2088)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-02-27 10:33:32 +01:00
Christoph Weitkamp
9c0302ec26
[profiles] Added 'Range' profile (#2046)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-02-27 10:28:09 +01:00
Mark Hilbush
7de57f9ffe
[automation] Fixed memory leak caused by invalid UI DSL rule (#2212)
Signed-off-by: Mark Hilbush <mark@hilbush.com>
2021-02-20 19:53:44 +01:00
bigbasec
c7b7390c91
Fix sitemap proxy URL provided by Rest API (#2203)
Signed-off-by: Brian Homeyer <bhomeyer@gmail.com>
2021-02-19 20:27:12 +01:00
pravussum
0292806830
[metering] tag rule metric with human readable rule name in addition to the rule id (#2194)
Signed-off-by: Robert Bach <openhab@mortalsilence.net>
2021-02-14 18:07:54 +01:00
Sami Salonen
ebda155b47
[modbus] Modbus poolconfig handling (#2199)
* [modbus] More strict nullness annotations
Taking into consideration that we always have default
EndpointPoolConfiguration
* [modbus] Utilize default pool configuration consistently
* [modbus] Make (internal) ModbusCommunicationInterfaceImpl constr private
* [modbus] Handle null config of modbus comm when detecting open conns
* [modbus] default connection timeout of 10s with default pool config

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
2021-02-14 17:14:43 +01:00
pravussum
f061512dd5
Integrated micrometer metering #774 (#2133)
Signed-off-by: Robert Bach <openhab@mortalsilence.net>
2021-02-11 21:12:58 +01:00
Wouter Born
5a4e04cb2c
Add profile to generate semantics classes with groovy-maven-plugin (#2188)
* Add profile to generate semantics classes with groovy-maven-plugin

This way you can generate the classes with Maven when adding -DgenerateTagClasses to your build command.
I.e. you no longer need to have Groovy locally installed for this.
Also properly sorts the generated imports so they match the Spotless configuration.

Signed-off-by: Wouter Born <github@maindrain.net>
2021-02-10 17:23:16 +01:00
Christoph Weitkamp
76e0cfdb81
[voice] Changed annotation of getPreferredVoice method to allow null results (#2186)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-02-09 19:26:49 +01:00
Kai Kreuzer
44c280e249
Make absolute color temperature channel type advanced (#2183)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-02-08 20:13:16 +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
Sönke Küper
65218f81fc
Added rule condition for not a holiday (#2043)
Signed-off-by: Sönke Küper <soenkekueper@gmx.de>
2021-02-06 16:37:29 +01:00
bigbasec
74c4c2386f
Support sitemaps created through UI in proxy (#2178)
* Add site provider lookup in proxy

Third attempt at this PR, but this very simply allows for the proxy to find the sitemaps for both file based as well as gui generated.

Fixes #2154
Fixes openhab/openhab-webui#763
Fixes openhab/openhab-webui#745

Also-by: Kai Kreuzer <kai@openhab.org>
Signed-off-by: Brian Homeyer <bhomeyer@gmail.com>
2021-02-06 16:26:58 +01:00
Kai Kreuzer
87211d2439
[REST] Prevent internal server error on invalid link requests on REST API (#2179)
Closes https://github.com/openhab/openhab-webui/issues/878

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-02-06 11:27:58 +01:00
Andrew Fiddian-Green
b99aa444a0
[discovery.upnp] Devices may apply a grace period for removal from the Inbox (#2144)
* [discovery.upnp] delay removing devices from Inbox

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2021-02-06 11:16:41 +01:00
Andrew Fiddian-Green
023f373b20
[transport.modbus] Remove dependencies on deprecated libraries (#2127)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2021-02-04 23:27:06 +01:00
Christian Bandowski
d48646d8c6
Fix changing temperature via BasicUI (#2091) (#2165)
Signed-off-by: Christian Bandowski <christian@myvm.de>
2021-01-30 22:50:58 +01:00
Sami Salonen
de61ce1ead
[modbus] equals and hashcode implementation for ModbusRegisterArray (#2164)
Signed-off-by: Sami Salonen <ssalonen@gmail.com>
2021-01-30 21:02:59 +01:00
Wouter Born
46666eb169
Fix deprecations (#2163)
Signed-off-by: Wouter Born <github@maindrain.net>
2021-01-30 12:22:31 +01:00
Wouter Born
49e148ad7d
Fix headers (#2161)
Signed-off-by: Wouter Born <github@maindrain.net>
2021-01-27 23:43:44 +01:00
Jonathan Gilbert
f1a3d824ac
Add ability for scripts to create unmanaged rules (#1897)
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
2021-01-26 22:25:09 +01:00
Jonathan Gilbert
f0c9a8434d
Added ability for ScriptEngines to allow script dependencies to be tracked and changes to trigger script reloading (#1884)
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
2021-01-26 22:23:31 +01:00
jimtng
b55933d769
[timer] fix to allow timer reschedule after termination (#2153)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2021-01-26 17:21:41 +01:00
jimtng
6de92ec6ef
[timer] Add Timer.getExecutionTime() (#2147)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2021-01-26 17:17:40 +01:00
Mike Major
86a447c23a
[jsondb] Restore zero byte files from backup (#2155)
* Restore zero byte files from backup
* Also handle zero byte backup files

Signed-off-by: Mike Major <mike_j_major@hotmail.com>
2021-01-26 17:12:46 +01:00
Christoph Weitkamp
12659595a6
Added system default channel type to control color temperature in Kelvin (#2157)
* Added system default channel type for controling color temperature in Kelvin

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-01-26 08:13:04 +01:00
Wouter Born
d50ea56da8
Stop commons-net proliferation (#2151)
* Exclude commons-net from core dependencies so it is no longer automatically a transitive compile dependency
* Update nrjavaserial compile dependency to a version that no longer includes commons-net packages
* Define and use commons.net.version property
* Rework features so commons-net is only installed when required

Signed-off-by: Wouter Born <github@maindrain.net>
2021-01-24 21:43:08 +01:00
Michael Parment
3df98da080
Changed modbus polling logging level to warning when retrying (#2135)
https://community.openhab.org/t/modbus-errors/114602

Signed-off-by: Michael Parment <michael.parment@gmail.com>
2021-01-21 14:16:40 +01:00
Fabian Wolter
0a2450c919
Add message and preserve cause when throwing PortInUseException (#2126)
Signed-off-by: Fabian Wolter <fw@skytender.de>
2021-01-21 11:12:55 +01:00
Andrew Fiddian-Green
127724c0e3
[executeCommandLine] should return STDERR if STDOUT is empty (#2114)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2021-01-16 22:20:09 +01:00
Kai Kreuzer
a0d58006e8
Also return command line execution result in case of error return code (#2104)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-01-12 10:54:12 +01:00
Christoph Weitkamp
c2702d0dfe
Moved NumberExtensionsTest from itest to pure unit test and merged redundant calsses (#2087)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-01-08 23:17:28 +01:00
Christoph Weitkamp
90a460dd03
Added unit tests for check if persistence extension returns QuantityType if persistence service returns QuantityType (#2029)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-01-08 22:53:35 +01:00
Paul van den Berg
eee30b0c57
Improved error logging when adding rules (#2053)
Improved error logging for adding rules

Signed-off-by: Paul van den Berg <prj.vandenberg@gmail.com>
2021-01-06 23:23:17 +01:00
Kai Kreuzer
97e2782875
[automation] Avoid disappearing rules by correctly checking the model and its type (#2077)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-01-06 14:29:49 +01:00
Vita
0026d89caf
Extended serial port implementation (#2050)
Signed-off-by: docbender <vita.tucek@seznam.cz>
2021-01-06 08:48:16 +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
64f444cf6e
Update Mockito, JUnit and use MockitoExtensions in itests (#2075)
* Updates Mockito to 3.7.0
* Updates JUnit to 5.7.0
* Use MockitoExtensions where possible

Signed-off-by: Wouter Born <github@maindrain.net>
2021-01-05 22:58:58 +01:00
Christoph Weitkamp
88253c8676
Add category for system channel type 'power'; Changed category for system channe type 'low-battery' (#2069)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-01-05 22:53:58 +01:00
Yannick Schaus
fcaf251bd0
Fix parsing integer & booleans parameters in UI component based sitemaps (#2072)
* Fix parsing integer & booleans parameters in UI component based sitemaps

Also catch remaining exceptions and log a warning/ignore the parameter
instead of making the whole sitemap building process fail.

Fix wrong feature ID for the video widget URL.

Fixes #2047.
Fixes #1987.
Fixes #1898.
Fixes #1875.
Fixes https://github.com/openhab/openhab-webui/issues/745.

Signed-off-by: Yannick Schaus <github@schaus.net>
2021-01-05 22:42:31 +01:00
Kai Kreuzer
531a478a45
Cache parsed script in order to improve performance (#2057)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-01-03 13:18:53 +01:00
Kai Kreuzer
d11ec3ef64
Include group label in warn log message (#2059)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-01-03 13:17:53 +01:00
Christoph Weitkamp
2cf9babfab
Added method to read all files with specific extensions in 'transform/' folder (#2052)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-01-03 10:01:09 +01:00
Kai Kreuzer
4b8546b599
Prevent errors in log when client closes the HTTP connection (#2049)
Fixes openhab/openhab-distro#1188

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2021-01-02 09:04:05 +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
Sami Salonen
afd03df07f
[transport.modbus] Support dimensionless QuantityType commands. (#1984)
In additions, command->registers tests have been once made more
readable, covering all the corner cases with integers.

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
2020-12-31 10:13:43 +01:00
Mark Hilbush
890e767d0a
[persistence] Fix varianceSince and deviationSince (#2036)
Signed-off-by: Mark Hilbush <mark@hilbush.com>
2020-12-30 22:55:41 +01:00
Kai Kreuzer
1c3e4318df
Correctly handle file extension when looking up script (#2020)
Fixes #1990

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-29 10:50:31 +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
Andrew Fiddian-Green
acb0cd5e9b
[transport.modbus] Added support for RTU encoding over TCP (#1965)
* [modbus] add support for rtu encoding over tcp

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2020-12-26 18:10:06 +01:00
Leon Kiefer
49a17a5f5e
[automation] Updated rule dsl filename to rule uid mapping (#2003)
use full filename without extension as uid for rules provided by DSL files
fix bug where rule filenames with common prefix and "." resulted in same uid

Signed-off-by: Leon Kiefer <leon.k97@gmx.de>
2020-12-25 13:58:31 +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
Christoph Weitkamp
19daef5d09
Harden ChartServlet against NPEs when no 'period' parameter is given (#1992)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-23 12:57:27 +01:00
Christoph Weitkamp
0af74400d2
Added nullness annotations to ThingHandlerHelper (#1993)
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 (#1986)
Closes #1813

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 (#1985)
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 (#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
Christoph Weitkamp
f83fc07c6a
[automation] Added ItemStateUpdate action (#1970)
* 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 (#1971) 2020-12-20 13:50:24 +01:00
Yannick Schaus
150ced7012
[auth] Don't allow creating API tokens with no name (#1969)
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 (#1968)
Fixes #1967

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 (#1963)
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 (#1962)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-18 22:07:19 +01:00
Kai Kreuzer
4a108e5c80
Reintroduce delayed rule initialization (#1960)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-18 20:04:28 +01:00
Yannick Schaus
cc7edadd96
Auth messages translations (RC2) (#1957)
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 (#1953)
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 #1943 

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-16 23:21:47 +01:00
Christoph Weitkamp
d37fa48da4
Temporarily hide ThingAction in UIs (#1947)
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 #1946

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()' (#1948)
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 (#1940)
Fixes #1763

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-16 15:11:46 +01:00
Kai Kreuzer
2b9f890831
Stabelized automation integration test (#1944)
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 (#1942)
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 (#1939)
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 (#1933)
Related to #1848

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 (#1932)
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 (#1930)
This is the PR with the messages.properties files in
Dutch, German (partial) and Italian extracted from
#1929 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 (#1925)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-13 13:17:35 +01:00
Wouter Born
001c00a8c3
Fix remaining deprecations (#1918)
Fixes #1408

Signed-off-by: Wouter Born <github@maindrain.net>
2020-12-13 12:22:43 +01:00
Kai Kreuzer
ec6ac00742
increase the rule refresher delay (#1920)
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 (#1922)
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 (#1923)
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 (#1919)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-13 09:31:09 +01:00
openhab-bot
91469ddb9b
New Crowdin updates (#1921)
* 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 (#1913)
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 (#1915)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-12 22:35:20 +01:00
Christoph Weitkamp
3293bac779
Register CommunicationManager as ItemChannelLink listener (#1917)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-12 21:55:37 +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
Christoph Hofmann
bbede78dc9
Added operationIds for OpenAPI specification (#1861)
Signed-off-by: Christoph Hofmann <christoph@hofmann.pm>
2020-12-10 23:12:11 +01:00
Christoph Weitkamp
fe677966af
[link] Use constructor injection (#1911)
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 (#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
silamon
2f5a6269c2
[semantics] Remove semantic metadata on item tag removal (#1860)
* Remove semantic update on tag removal

Fixes #1841

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 (#1892)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-08 12:55:52 +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
f99135ae3d
Reverted the introduction of an automation threadpool (#1890)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-05 11:50:16 +01:00
silamon
34a3487e3e
Disable AutoUpdateManager for GroupItems (#1862)
* Disable AutoUpdateManager for GroupItems

Fixes #1330 

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 (#1880)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-03 09:28:07 +01:00
Wouter Born
6e0a5d0260
Improve tags_nl.properties (#1883)
* 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 (#1879)
Related to #1791

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 (#1854)
* 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 (#1770)
* introduced implicit variable "triggeringItemName"

Fixes #1768

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-01 20:29:50 +01:00
Christoph Weitkamp
cd0654806b
Fixed config description (#1873)
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 (#1874)
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 (#1870)
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 (#1872)
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 (#1865)
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 (#1864)
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 (#1869)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-30 10:18:56 +01:00
Marcel
aa317d8c85
Fix typo in TriggerChannelTypeBuilder (#1866)
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 (#1858)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-29 11:12:03 +01:00
Kai Kreuzer
fe62a4fdae
Make maps thread safe (#1856)
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 (#1857)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-29 10:56:01 +01:00
Christoph Weitkamp
109fae9974
[profiles] Added 'Hysteresis' profile (#1726)
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 (#1843)
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 (#1853)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-27 15:02:04 +01:00
lolodomo
f6d3f1d560
[semantics] Ontology enhanced (#1814)
Related to #1791

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 (#1848)
Fix #1783

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 (#1807)
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 (#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
Jonathan Gilbert
60edebc111
Pass script context to script engines (#1837)
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 (#1827)
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 (#1839)
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 (#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
Wouter Born
d5e7fe3ab3
Update LastNPE EEAs to 2.2.1 (#1821)
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 (#1819)
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 (#1756)
* Change metadata selector

Fixes #1692

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 (#1799)
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 (#1817)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-14 13:46:03 +01:00
lolodomo
8102cffb7f
Log reason for rules/scripts refresh (#1812)
* Log reason for rules/scripts refresh

Fixes #1293

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 (#1809)
Fixes #1802 

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 (#1811)
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 (#1806)
Fixes #1793 

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 (#1563)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-10 22:40:55 +01:00
Sonic-Amiga
3b65a9c556
transport/mqtt: Introduce setUnsubscribeOnStop() function (#1724)
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 (#1795)
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 (#1794)
* 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 (#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
Kai Kreuzer
35b0a1275e
[charts] Add support for QuantityTypes to DefaultChartProvider (#1789)
Fixes #1781

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-02 10:45:31 +01:00
Kai Kreuzer
5a9c5e7d87
strip unit from historic states (#1782)
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' (#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
radicale
ae26ce4618
Fixed typo in class name TrustAllTrustMananger. Will probably require changes in bindings as well. (#1773)
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 (#1750)
* Allow dashes in rule file names

Fixes #1728

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

Related to #1734

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-20 15:50:25 +02:00
Yannick Schaus
d262b6f5bc
Add missing roles checks (#1739)
(I included these fixes in #1735 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 #1713, 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 (#1737)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-19 22:47:28 +02:00
Christoph Weitkamp
7d70a97b77
Fixed IndexOutOfBoundsException in ScriptModuleTypeProvider (#1730)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-19 13:41:58 +02:00
Wouter Born
b2c045d0fe
Fix build by wrapping lines (#1729)
Caused by #1713

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 (#1713)
* Allow basic authentication to authorize API access

Closes #1699.

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 (#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
Christoph Weitkamp
4ba70778d1
Added validation for relation between ThingUID and BridgeUID (#1704)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-17 17:59:34 +02:00
Wouter Born
605c1c238c
Add Automation extension type (#1722)
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 (#1720)
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 (#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
Wouter Born
0d1a15ef34
Update ActionService and ThingActions classes in Xtext cache (#1714)
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 #1265
Fixes #1694

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-13 23:17:57 +02:00
Wouter Born
7d8126e89f
Fix ScriptEngine parameter option removal (#1716)
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 (#1705)
* 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 (#1712)
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 (#1710)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-10-10 20:04:25 +02:00
Wouter Born
159aefffa5
Remove unused DBus Transport (#1708)
Related to #960

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-10 08:08:22 +02:00
Connor Petty
0dfda1e7f6
Make ExecUtil more robust (#1700)
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>)' (#1703)
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 (#1698)
* 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 #1499

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-07 20:20:52 +02:00
Wouter Born
44b1823e97
Fix two typos (#1691)
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 (#1690)
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 (#1688)
* 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 (#1685)
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 (#1680)
* Filter empty i18n config parameter options

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

Related to #1662

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

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-02 08:19:02 +02:00
Wouter Born
9739271b52
Fix sitemap subscription cleanup (#1679)
* 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 #1674

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 (#1671)
This removes the remaining deprecated MQTT transport code which was not part of #1668.

Related to #1408

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

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-24 14:57:01 +02:00
Wouter Born
6b97328189
Fix ConfigurableService deprecations (#1666)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-24 14:55:50 +02:00
Wouter Born
c5541a0391
Remove deprecated handleUpdate from ThingHandler (#1669)
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 #1408

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 (#1634)
* 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 #1596

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

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

Related to #1408

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-23 19:06:29 +02:00
Wouter Born
f845772ab0
Remove deprecated BaseThingHandler.initialize() (#1665)
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 (#1661)
The path is incorrect because a bug was introduced in #1650.
This results in the MapTransformationServiceTest failing so it was disabled in openhab/openhab-addons#8519.

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

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 (#1658)
Fixes #1655

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-20 14:28:06 +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
HoLLe
5ab248c158
[REST API] fixed small typo (#1654) 2020-09-19 13:02:56 +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
Wouter Born
5919f923d5
Increase StartlevelEvent delay to 15 seconds (#1649)
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 #1637

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 (#1650)
Fixes #1636

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 (#1647)
Fixes #1639

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 (#1641)
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 (#1643)
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 (#1414)
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 (#1631)
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 (#1629)
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 (#1616)
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 (#1628)
* 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 #1486

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-07 19:45:33 +02:00
Wouter Born
2273f8976f
Fix potential NPE in ProfileCallbackImpl (#1627)
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 (#1626)
The changes in #1614 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 (#1625)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-09-07 10:45:15 +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
Wouter Born
aee47e6381
Remove deprecated FilterCriteria methods (#1623)
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 (#1621)
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' (#1573)
* 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 (#1619)
* 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 (#1481)
* 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 (#1551)
* 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. (#1592)
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 (#1617)
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 (#1614)
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 (#1611)
With the changes in #1598 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 (#1610)
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 (#1603)
* 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 (#1608)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-23 10:48:03 +02:00
Kai Kreuzer
3ada0d0148
cleaned up some remainders (#1607)
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 (#1606)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-22 23:12:38 +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
pacive
0173e23759
Fix tests failing on windows (#1602)
* 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 (#1605)
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 (#1604)
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 (#1597)
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 (#1600)
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 (#1595)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-15 10:54:41 +02:00
Kai Kreuzer
545608dab3
registered static methods as extensions (#1594)
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 (#1591)
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 (#1590)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-14 10:06:42 +02:00
Kai Kreuzer
3c83e8a8eb
switched PersistenceExtensions to ZonedDateTime (#1588)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-12 21:59:55 +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
86b02c26be
Use "openhab" console scope (#1586)
Fixes #1566

Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-11 20:38:24 +02:00
Kai Kreuzer
bab473016c
reduced log levels of ExecUtil (#1584)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-08-11 17:42:44 +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
29dfb967c4
Migrate to OpenAPI 3 annotations (#1576)
* 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 (#1575)
* 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 (#1572)
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 (#1570)
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 (#1496)
Signed-off-by: Yannick Schaus <github@schaus.net>
2020-07-24 22:30:06 +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
Kai Kreuzer
e228d490d8
Made swagger visible in the RootResource (/rest) (#1568)
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 (#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
65b16404c0
Use more java 8 features: Replace Collections.sort() with List.sort() (#1564)
- Use more java 8 features: Replace Collections.sort() with List.sort()

Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-22 11:24:33 +02:00
Christoph Weitkamp
c747f7f9bb
Fixed removal / replacement of annotated ThingActions (#1536)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-21 19:44:55 +02:00
Christoph Weitkamp
4585dac84a
Avoid ArithmeticException if timeSpan is zero (#1562)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-21 19:33:13 +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
2ee2e2d2f5
[rest] introduce nickname attribute to make operationId unique (#1546)
The getAll() method in the ConfigDescriptionResource does not have a nickname set in its ApiOperation annotation.
Swagger uses the method name (getAll) as default operationId which is not unique.

Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-21 11:11:45 +02:00
Paul Vogel
2adc918409
Change responseContainer from Collection to List (#1555)
In order to change to a valid type since the documentation suggests "Valid values are "List", "Set" or "Map". Any other value will be ignored.".

Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-20 18:33:19 +02:00
Paul Vogel
ccde410d6a
Change responseContainer from Collection to List (#1554)
In order to change to a valid type since the documentation suggests "Valid values are "List", "Set" or "Map". Any other value will be ignored.".

Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-20 18:31:33 +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
Paul Vogel
6966c2fc21
[rest] introduce nickname attribute in ApiOperation annotation to make operationIds unique (#1544)
Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-19 00:33:23 +02:00
Paul Vogel
6078d9a949
Change responseContainer from Collection to List (#1553)
In order to change to a valid type since the documentation suggests "Valid values are "List", "Set" or "Map". Any other value will be ignored.".

Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-19 00:25:07 +02:00
Christoph Weitkamp
4b77d29f13
Added nullness annotations and constructor injection for ConsoleCommandExtensions (#1549)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-17 21:12:08 +02:00
Christoph Weitkamp
236efd5862
Clarification in JavaDoc about QueryablePersistenceService methods (#1552)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-16 21:02:04 +02:00
Christoph Weitkamp
729efeb37a
Improved ThingHandlerService registrations / removals (#1548)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-16 19:11:44 +02:00
J-N-K
558f518feb
Added utility console commnds for removing orphan links (#1395)
* Added utility console commands for removing orphan links

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
2020-07-15 10:30:31 +02:00
silamon
c788f2f7c8
[rest] Use same regex as install and uninstall resource (#1543)
Signed-off-by: Simon Lamon <simonlamon93@hotmail.com>
2020-07-12 09:50:27 +02:00
Christoph Weitkamp
991ccd6599
Remove deprecated method of 'ConfigOptionProvider' (#1541)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-12 00:32:37 +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
Christoph Weitkamp
7196146dfc
Fixed TimerImpl and added unit tests (#1530)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-09 23:20:47 +02:00
Christoph Weitkamp
1166dc4677
[discovery] Minor clean-ups for discovery (#1539)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-09 23:17:33 +02:00
Christoph Weitkamp
a142e6746e
[rest] Suppress ISE in 'SseBroadcaster' if sink already has been closed (#1540)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-09 23:16:01 +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
ecc1f15241
Allow negative numbers in metadata for Items (#1517)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-06-24 22:06:53 +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