Commit Graph

422 Commits

Author SHA1 Message Date
Florian Hotze
e1741cf61d
[rest] Add caching for TagResource & De-duplicate code for caching (#3729)
* [rest] Add caching for TagResource
* [core] Add & use RegistryChangedRunnableListener class

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-07-25 20:59:39 +02:00
Kai Kreuzer
5692232e2b Apply spotless
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-07-24 01:11:37 +02:00
openhab-bot
fd93f0a766 [unleash-maven-plugin] Preparation for next development cycle. 2023-07-23 17:14:35 +00:00
J-N-K
9ba8e71c54
Add unit "calorie" (#3684)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-15 22:18:27 +02:00
J-N-K
141b7b637a
Increase large event queue warn limit (#3702)
On larger installations with 1000+ items the limit of 1000 elements in the queue is exceeded easily. Since no events are lost (they just take longer to be processed), the limit that needs to be exceeded before a warning is issued should be increased.

See reports on the forum.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-14 21:47:14 +02:00
lolodomo
591b16ff35
Avoid null hash warning in WatchServiceImpl when possible (#3691)
Fix #3680

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-07-07 20:26:12 +02:00
J-N-K
a656073352
Improve performance for state update handling (#3635)
* Improve threading in EventHandler
* refactor pagechangelistener to event
* One executor per subscriber type, not per subscriber

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-07-02 12:12:53 +02:00
Gwendal Roulleau
3ec1457583
[audio] Improve audio duration computation (#3675)
Allows the use of a Sizeable interface (for AudioStream that we know the length of, but we cannot clone). We can then improve the duration detection, for example for the pulseaudio sink (PR coming after).
We can also give the length information to sink in more cases.

Add the support of the mark / reset methods to some common AudioStream. We then allow more stream analysis for sink requiring it (Stream analysis often requires to get back in time after consuming a few bytes)

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
2023-07-02 11:19:34 +02:00
Gwendal Roulleau
8eddad5c76
[audio] Enhance AudioSink capabilities using the AudioServlet (#3461)
* [audio] More capabilities for AudioSink using the AudioServlet

AudioServlet can now serve all type of AudioStream multiple times by buffering data in memory or in temporary file.
Adding method to ease disposal of temporary file after playing a sound
Adding an identifyier to audio stream for further development (allow audio sink to cache computation data)

We can now send audio with a Runnable for a delayed task to be executed after. This delayed task includes temporary file deletion and volume restoration.
This is a no breaking change / no behaviour modification for other addon AudioSink, as existing AudioSink must explicitly override the old behaviour to use this capability.
Add AudioSinkSync / AudioSinkAsync abstract classes to use this capability easily.
WebAudioSink now implements this capability, with the help of a modified AudioServlet

Adding (approximative, better than nothing) sound duration computation method for MP3 and WAV.
Use this sound duration computation to guess when the async sound is finished and when to do the post process (i.e. volume restoration)

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
2023-06-16 21:54:11 +02:00
openhab-bot
5550ea79b2
New Crowdin updates (#3639)
* New translations audio.properties (Romanian)

* New translations addons.properties (Romanian)

* New translations i18n.properties (Romanian)

* New translations network.properties (Romanian)

* New translations marketplace.properties (Romanian)

* New translations validation.properties (Finnish)

* New translations scriptprofile.properties (French)

* New translations scriptprofile.properties (Slovenian)

* New translations validation.properties (Hebrew)

* New translations validation.properties (Polish)

* New translations validation.properties (Slovenian)

* New translations hli.properties (French)

* New translations hli.properties (Polish)

* New translations automation.properties (Hebrew)

* New translations automation.properties (Polish)
2023-05-29 14:26:59 +02:00
openhab-bot
3e8905bcb7
New Crowdin updates (#3638)
* New translations lsp.properties (Italian)

* New translations hli.properties (Italian)

* New translations addons.properties (Finnish)

* New translations automation.properties (Italian)

* New translations LanguageSupport.properties (Portuguese)
2023-05-28 13:20:05 +02:00
J-N-K
88bb76c21c
Add event information in rules for time, manual and RunRuleAction trigger (#2965)
* Add event information for time triggers

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-28 10:15:16 +02:00
J-N-K
796f66a2fa
Add a ScriptEngineFactory bundle tracker (#3275)
* Add a ScriptEngineFactory bundle tracker

The `ScriptEngingeFactoryBundleTracker` tracks all bundles that provide `ScriptEngineFcatory` capabilities and sets a `ReadyMarker` if all of them are activated.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-27 21:48:16 +02:00
J-N-K
ed392eec86
[rest] Add endpoint for UoM information (#3611)
* [rest] Add endpoint for UoM information

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-27 21:10:32 +02:00
J-N-K
ee6d7b39b2
Fix NPE in WatchServiceImpl (#3633)
It was reported on the forum that in some cases the hash is null.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-27 19:19:25 +02:00
Andrew Fiddian-Green
4d3535a411
[ColorUtil] optimise constants; hue overflow check (#3629)
* [ColorUtil] define constants; fix hue overflow

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2023-05-26 10:32:29 +02:00
J-N-K
cd06e6d324
Fix event ordering for item events (#3628)
Posting the `ItemAddedEvent` after notifying the listeners results in `ItemStateUpdated/ChangedEvents` before the `ItemAddedEvent` because the state could be altered by persistence services. This is at least unexpected and can be fixed by swapping the order.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-25 19:58:11 +02:00
J-N-K
cd7840dc63
Add dimension RadiationSpecificActivity (#3608)
* Add dimension RadiationSpecificActivity

This can be used e.g. for radon monitoring. The unit Bq/m3 was wrongly assigned to the dimension `Density` before.

Signed-off-by: Jan N. Klug <github@klug.nrw>

* improvement

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-20 09:42:58 +02:00
Hans Böhm
f92424c0b8
Add unit rpm (#3616)
Signed-off-by: Hans Böhm <h.boehm@gmx.at>
2023-05-17 11:47:53 +02:00
J-N-K
0f1f1729b7
Reduce loglevel in UnitUtils (#3609)
The log level was increased during the UoM refactoring but it turns out that a lot of code depends on failing silently. Therefore the log level is again reduced to DEBUG.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-13 20:50:53 +02:00
openhab-bot
08924232fc
New Crowdin updates (#3589)
* New translations DefaultSystemChannels.properties (Greek)

* New translations restauth.properties (Greek)

* New translations voice.properties (Greek)

* New translations scriptprofile.properties (Greek)

* New translations i18n.properties (Greek)

* New translations validation.properties (Italian)

* New translations validation.properties (French)

---------

Signed-off-by: J-N-K <github@klug.nrw>
Co-authored-by: J-N-K <github@klug.nrw>
2023-05-13 17:54:26 +02:00
J-N-K
9ef076dc6a
[uom] Add unit metadata for NumberItem (#3481)
* Add defaultUnit metadata for NumberItem

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-09 22:42:25 +02:00
J-N-K
cdab53b814
Change default imperial unit for length to inch (#3587)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-01 15:04:59 +02:00
Holger Friedrich
5e0a4ff25a
Reduce SAT warnings (#3586)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-05-01 09:08:26 +02:00
Holger Friedrich
a77a303dc3
Code cleanup: Use Java 17 features (#3585)
* Code cleanup: Use Java 17 features

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-05-01 08:27:15 +02:00
Andrew Fiddian-Green
da5ac36a68
Improve precision of ColorUtil (#3542)
* [ColorUtil] add fine precision methods and tests
* [ColorUtil] set precision to 5

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
2023-04-21 21:31:16 +02:00
Wouter Born
3c6d855d4b
Remove redundant public and abstract modifiers from interfaces (#3560)
* Remove redundant public modifiers from interfaces
* Remove redundant abstract modifiers from interfaces

Signed-off-by: Wouter Born <github@maindrain.net>
2023-04-20 20:22:58 +02:00
Holger Friedrich
769aa562a1
Code cleanup: Use Java 17 features (#3522)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-04-16 21:43:59 +02:00
Jacob Laursen
eb6b6b9677
[oauth] Add support for custom deserialization of AccessTokenResponse (#3537)
* Add possibility to inject custom GsonBuilder

Reverts #1891

Fixes #1888

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2023-04-14 21:19:08 +02:00
Holger Friedrich
b0b8bb547b
Reduce rounding errors of RGB/HSB conversion and enhance ColorUtil (#3479)
* HSBType: Reduce rounding errors of RGB/HSB conversion
* Move RGB to HSV conversion to ColorUtil
* Restructuring HSBType and ColorUtil

- Move RBG/HSB conversion from HSBType to ColorUtil
- Rename helper functions "hsv" to "hsb" to be consistent with HSBType
- Add parameterized tests

Co-authored-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-04-07 18:43:01 +02:00
J-N-K
3047ed42a5
Prevent unnecessary MODIFY events in WatchServiceImpl (#3524)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-04-07 14:47:08 +02:00
Florian Hotze
633002c647
Fix wrong event subscription in CommunicationManager (#3529)
* Fix wrong event subscription in CommunicationManager

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-04-07 14:26:19 +02:00
J-N-K
ee392e861f
Fix WatchService tests (#3518)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-04-04 07:33:16 +02:00
Wouter Born
4851bfbcae
Fix recently introduced SAT issues (#3516)
* Fix recently introduced SAT issues

Signed-off-by: Wouter Born <github@maindrain.net>
2023-04-01 17:18:22 +02:00
Holger Friedrich
74052e7bcd
Code cleanup: Use Java17 features (#3508)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-04-01 09:51:12 +02:00
J-N-K
4182980ec8
Add ItemStateUpdatedEvent and enable group channel-links (#3141)
* Add (Group)ItemStateUpdatedEvent

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-31 23:01:40 +02:00
GiviMAD
4d0dba1abc
Fix OOBE in item metadata descriptions providers (#3488)
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-03-30 20:33:21 +02:00
J-N-K
6294c48be4
Use try-with-resources on Files.walk/Files.list (#3504)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-29 09:54:41 +02:00
GiviMAD
b6c8aeaf10
Allow using quotes in metadata state/command description value/label (#3363)
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-03-26 19:30:21 +02:00
J-N-K
9289fd5a78
Bump spotless and fix formatting (#3469)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-20 23:14:59 +01:00
J-N-K
a32f1e0253
Add ColorUtil for better support of xyY conversion (#3434)
* Add ColorUtil for better support of xyY conversion

This has been refactored to align with the usually used conversion by a lot of ZigBee products like Hue or Deconz.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-16 22:25:03 +01:00
J-N-K
c05fe8ad4d
Fix ready marker ordering on late subscriptions (#3454)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-13 21:15:55 +01:00
jimtng
f9751448c1
Fix ISE during WatchService disposal (#3432)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2023-03-07 15:43:45 +01:00
J-N-K
278e99b461
Fix IllegalStateException in WatchServiceImpl (#3389)
Added a check to prevent attempts to unregister already unregistered service

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-05 09:44:58 +01:00
J-N-K
07e8ff56c7
Prevent duplicate events in WatchService (#3404)
On Samba shares a single MODIFY event may result in different sequences of CREATE/DELETE/MODIFY events. Unfortunately this is not properly handled by the underlying library and we have to re-introduce our ugly workaround. The solution itself is a bit improved over the old one as it not only keeps the last event but determines the correct event by examining the sequence of received events.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-05 09:44:23 +01:00
Wouter Born
ec3af50f11
Upgrade to Karaf 4.4.3 (#3252)
* Sync runtime dependencies with Karaf 4.4.3, most notably:
  * Jetty 9.4.50.v20221201
  * Pax Logging 2.2.0
  * Pax Web 8.0.15
* Use OSGi R8 as compile dependency
* Rework Servlets to use Http Whiteboard annotations in favor of proprietary `org.openhab.core.io.http.servlet` classes
* Resolve itest runbundles

Also-by: Jan N. Klug <github@klug.nrw>

Signed-off-by: Wouter Born <github@maindrain.net>
2023-03-01 13:09:07 +01:00
Gwendal Roulleau
5544945d48
[tts] Cache mechanism (#3057)
* [tts] Cache mechanism

Implements a cache mechanism for all TTS services.
Eviction policy is LRU mode.
This cache can serve several streams concurrently, for the same utterance, with only one call to the TTS. It doesn't wait for the stream to end and can serve data rapidly.
Cache size is a voice bundle parameter (10 mb default)

Closes #3039

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
2023-02-28 08:45:44 +01:00
openhab-bot
ccef3d24ff
New Crowdin updates (#3395)
* New translations DefaultSystemChannels.properties (Czech)

* New translations addons.properties (Czech)

* New translations marketplace.properties (Czech)

* New translations restauth.properties (Czech)

* New translations voice.properties (Czech)

* New translations validation.properties (Czech)
2023-02-24 20:25:02 +01:00
J-N-K
dff6f9b984
Refactor XML handling (#3385)
* Refactor XML handling for things
* integrate config.xml and improve naming

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-02-23 20:06:29 +01:00
J-N-K
c17481c2ac
Align AbstractScriptDependencyTracker with AbstractScriptFileWatcher (#3372)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-02-18 09:17:59 +01:00