Commit Graph

2318 Commits

Author SHA1 Message Date
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
lolodomo
f86635fe96
[rest] Add semantic tag registry + API to manage user tags (#3646)
* Add semantic tag registry + REST API to manage user tags

Related to #3619

New registry for semantic tags.
New default semantic tags provider for all built-in semantic tags.
New managed provider to add/remove/update user semantic tags.
Storage of user semantic tags in a JSON DB file.
New REST API to add/remove/update user tags in the semantic model.
New REST API to get a sub-tree of the semantic tags.

Semantic tag class annotations are removed.

Semantic tag classes are now created at runtime.
Classes Locations, Equipments, Points and Properties are removed

Static methods SemanticTags.add removed
The adding of semantic tag classes is now managed only by the tag registry.

Avoids calling static method SemanticTags.getById when possible

SemanticsMetadataProvider service now requires semanticTagRegistry to start.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-06-16 16:38:03 +02:00
Yannick Schaus
6e83d3f8de
"Cacheability" option for critical REST resources (#3335)
* Closes #3329.

This implements a new optional `cacheable` parameter for these REST endpoints:
- `/rest/items`
- `/rest/things`
- `/rest/rules`

When this parameter is set, a flat list of all elements excluding
non-cacheable fields (e.g. "state", "transformedState", "stateDescription",
"commandDescription" for items, "statusInfo", "firmwareStatus",
"properties" for things, "status" for rules) will be retrieved along with
a `Last-Modified` HTTP response header. When unknown, the Last-Modified
header will be set to the date of the request.

Also only when this parameter is set, and a `If-Modified-Since` header is
found in the request, that header will be compared to the last known
modified date for the corresponding cacheable list. The last modified date
will be reset when any change is made on the elements of the underlying
registry. If the `If-Modified-Since` date is equal or more recent than the
last modified date, then a 304 Not Modified response with no content will
be served instead of the usual 200 OK, informing the client that its
cache is still valid at the provided date.

All other request parameters will be ignored except for "metadata" in the
`/rest/items` endpoint. When a metadata selector is set, the resulting
item list will be considered like a completely different resource, i.e.
it will have its own last modified date. Regarding metadata, the approach
to invalidating last modified dates is very conservative: when any metadata
is changed, all cacheable lists of items will have their last modified date
reset even if the change was in a metadata namespace that wasn't requested.

This also implements the abovedescribed behavior for the
`/rest/ui/components/{namespace}` endpoint, but no `cacheable` parameter
is necessary. The last modified date is tracked by namespace.

Signed-off-by: Yannick Schaus <github@schaus.net>
2023-06-15 20:16:14 +02:00
J-N-K
885a8548c8
Improve community marketplace addon handler (#3641)
Allow unusual jar naming convention

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-06-11 22:36:34 +02:00
J-N-K
545ecfee21
Also adjust system channel types for unit (#3649)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-06-11 21:25:16 +02:00
J-N-K
7e734b8540
Fix AuthFilter service declaration (#3651)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-06-11 21:22:26 +02:00
GiviMAD
e3396c9477
[websocket] Allow registering websocket adapters (#3622)
* [WebSocket] Allow register websocket handlers

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2023-06-10 15:35:23 +02:00
Florian Hotze
be7488958d
[sse] Add type information to state event (#3647)
* SSE Item state stream: Provide state type

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* Add comment for method source

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

---------

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-06-08 14:31:34 +02:00
J-N-K
f36ccea50c
Bump jose4j (#3645)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-06-08 13:26:43 +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
d34b9164f7
Trigger immediately when start level already reached (#3278)
* Trigger immediately when start level already reached

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-28 10:14:03 +02:00
J-N-K
86abf68727
Fix build (#3637)
copyright outdated

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-28 09:23:24 +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
jimtng
6bb15b806c
Add getAllStatesSince() and getAllStatesBetween() to PersistenceExtensions (#3466)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2023-05-27 21:33:48 +02:00
J-N-K
7843b6872a
Add group name to GroupStateTriggerHandler (#3536)
* Add group name to GroupStateTriggerHandler

When triggering on state change/update of group member, the group is not available in the rule context (because the event is the `ItemStateChanged/UpdatedEvent` that caused the group to change/update. This adds a new element `triggeringGroup` to the rule context.

This is useful for generalized rules that trigger on different groups.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-27 21:30:34 +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
J-N-K
c6a4dd2a31
Remove package support from FeatureInstaller (#3634)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-27 19:14:48 +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
a8a5e86fb9
Fix NPE in UpgradeTool when no pattern present (#3630)
Reported on the forum. State descriptions do no necessarily contain a pattern and thus `.get("pattern")` can return null.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-25 19:19:06 +02:00
J-N-K
0df4857b11
Move RuleHLI service from voice to system (#3625)
This is needed to clean-up UI. The categories should be used for add-ons while core services should use `system`.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-25 08:38:59 +02:00
J-N-K
9e088f8c62
Move LSP service from misc to system (#3626)
This is needed to clean-up UI. The categories should be used for add-ons while core services should use `system`.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-25 08:37:50 +02:00
J-N-K
8e81bebd3a
Fix exception in TransformationHelper (#3627)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-25 08:36:45 +02:00
Kai Kreuzer
a12d64d4a3
Update to SAT version 0.15.0 (#3623)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-05-23 09:10:54 +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
J-N-K
3eca30f2c1
Fix Upgradetool does not remember last executed step (#3621)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-20 09:38:28 +02:00
J-N-K
d87007a585
Fix only first group config considered in persistence manager (#3618)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-18 11:00:45 +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
6eb49577fe
Fix UpgradeTool execution log (#3614)
It seems that in some cases GSON is not able to correctly serialize/deserialize ZonedDateTime. Since we do not depend on the value in any case (it's just informational), we can store a String instead.

A missing metadata database also failed the check when upgrading items. This has been fixed, too.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-14 18:43:43 +02:00
J-N-K
55d6d21f1f
Fix marketplace add-on services fail after upgrade (#3572)
* Fix marketplace add-on services fail after upgrade

A format change in the database (related to the introduction of addon.xml) leads to a non-migrateable and permanent error that floods the log with exceptions and malfunctions.

If such an error is detected, the database is purged and an error logged.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-13 20:55:17 +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
fbd7f9cbff
Fix UpgradeTool and enable default=all policy (#3607)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-12 22:22:38 +02:00
Matthew Skinner
c2ce05a550
Bump Netty version to 4.1.92.Final (#3577)
Bump Netty to latest versions.

Signed-off-by: Matthew Skinner <matt@pcmus.com>
2023-05-11 07:03:37 +02:00
Holger Friedrich
09f3de3889
Upgrade SAT to 0.14.0 (#3599)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-05-11 07:00:34 +02:00
lolodomo
e4e23e3ccb
Fix failed persistence tests (#3601) 2023-05-10 15:56:25 +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
67b80af872
Fix storing of StateDescriptionFragment in AbstractStorageBasedTypeProvider (#3598)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-09 18:10:47 +02:00
lolodomo
6af9870c50
Fix build (AbstractStorageBasedTypeProviderTest) (#3596)
Fix #3594

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-05-08 11:02:36 +02:00
J-N-K
8e1a2cfd0a
Add an AbstractStorageBasedTypeProvider (#3407)
* Add an AbstractDynamicTypeProvider

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-07 21:51:10 +02:00
J-N-K
960cf0c179
Improve thing updates (#3576)
* Improve thing updates

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-07 20:46:42 +02:00
J-N-K
2e00efc9bb
Allow managing persistence configurations and enable filters (#2871)
* Allow managing persistence configurations

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-07 20:33:28 +02:00
J-N-K
28ec419afd
Fix non-unique module handler identifiers (#3592)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-05 20:25:33 +02:00
J-N-K
d7ba8ad636
Improve message when rule action fails (#3593)
Also logs the full stacktrace at DEBUG level

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-05 20:16:55 +02:00
Kai Kreuzer
9c59071038
Make --dir param optional for upgradetool (#3591)
* Make --dir param optional for upgradetool

Almost all openHAB installations should have the $OPENHAB_USERDATA env variable set.
If this is the case, the user does not have to provide a directory, so this parameter can be made optional.

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-05-04 09:08:26 +02:00
Jacob Laursen
c8464870bb
[ephemeris] Add support for overriding holiday definitions (#3573)
* Add support for overriding holiday definitions

End Danish General Prayer Day

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2023-05-02 09:11:59 +02:00
Kai Kreuzer
476975a012
Allow OnOffType as valid conversion types for HSBType and PercentType (#3588)
* Allow OnOffType as valid conversion types for HSBType and PercentType
* Add clause for supported PercentType

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-05-02 09:10:34 +02:00