* [voice] Add length limit to TTS handled by cache
We can safely assume that long TTS are generated for report (meteo, chatGPT ?), probably not meant to be repeated, and so not cached.
Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
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>
* New translations scriptprofile.properties (Hungarian)
* New translations validation.properties (Hungarian)
* New translations automation.properties (Hungarian)
* New translations lsp.properties (German)
* New translations persistence.properties (German)
Instead of 5s before.
It helps triggering the end of playback earlier for audio sinks in asynchronous mode.
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Fix#3679
If not, calls of method limitToFields by PR #3335 fails when the list of
fields does not contain firmwareStatus.
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* 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>
* [voice] Add voice commands for register/unregister dialogs and list dialogs and dialog registrations
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
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>
* Always use ThingUid as the unique identifier for thing status metrics
At bind time, ThingId was being used, but then ThingUid was being used when changes occured,
causing multiple meters to be created for the same Thing, with the status always being 0 for
the meter created at bind time.
This change uses the full ThingUid, for both binding and event processing, since ThingUid is
the globally unique value.
Fixes#3672
Signed-off-by: Scott Hraban <scotthraban@gmail.com>
See: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/StringBuilder.html
> This class provides an API compatible with StringBuffer, but with no guarantee of synchronization.
> This class is designed for use as a drop-in replacement for StringBuffer in places where the string buffer was being used by a single thread (as is generally the case).
> Where possible, it is recommended that this class be used in preference to StringBuffer as it will be faster under most implementations.
Signed-off-by: Wouter Born <github@maindrain.net>
See title. This brings the query id in-line with the other add-on services.
Also adds correct content type.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* [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>
* 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>
* 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>
* 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)
* 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)
* 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>
* 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>
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>