* New translations addons.properties (Hungarian)
* New translations scriptprofile.properties (Hungarian)
* New translations systemprofiles.properties (Hungarian)
* New translations chart.properties (Hungarian)
* New translations voice.properties (Hungarian)
* New translations magic.properties (Hungarian)
* New translations jsr223.properties (Hungarian)
* New translations defaultsystemchannels.properties (Danish)
* Extend sitemap syntax for switch to support press & release buttons
Mappings attribute for switch element now accepts one or two commands for each button.
If only one command is provided, the button is a click button, the command is sent to the item when the button is clicked.
If two commands are provided (separated by ":"), the button is a press & release button, the first command is sent to the item when the button is pressed and the second when the button is released.
Syntax example for a click button: Switch item=DemoSwitch mappings=[ ON="ON" ]
Syntax example for a press & release button: Switch item=DemoSwitch mappings=[ ON:OFF="ON" ]
Related to #3822
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* Speed up calculations in rules
* Add test for NumberExtensions.numberToBigDecimal
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Co-authored-by: Holger Friedrich <mail@holger-friedrich.de>
Fix#2283Fix#4050
This PR is fixing two things in the computation of the displayState:
- If a transformation is present in the state pattern, it has now priority over options provided by the state description
- If no transformation is present in state pattern but options are provided by the state description, the provided state pattern is applied to the matching option
Also remove a deprecated call to transform.
If there is no transformation but options are provided without any matching with the current state and there is a pattern provided, then this pattern is used to format the output.
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* update reference to method / parameter names from documentation
* reflect that subscriptions for a whole page are possible in the documentation
* document that subscriptions to a whole sitemap are possible but discouraged
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
* Set a default presentation pattern for String/Number/Datetime items
A default state pattern was previously provided by ChannelStateDescriptionProvider only for String and Number items linked to a channel.
It is now the class DefaultStateDescriptionFragmentProvider which is responsible for providing the default state pattern for items, whether the item is linked to a channel or not.
This new class is the lowest ranked StateDescriptionFragmentProvider so that all other providers have priority in setting the state pattern.
Default pattern for string item: %s
Default pattern for datetime item or group with datetime state: %1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS
Default pattern for number item or group with number state: %.0f
Default pattern for number+dimension item or group with number+dimension state: %.0f %unit%
Closes#4071Closes#3835
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* Don't update unchanged things in .things file
There were two problems:
- The old things weren't removed, resulting in accumulation of duplicate things and comparing the new one against the old one resulting in erroneous update
- Numeric values (usually entered as integer) in a newly loaded Channel Configuration properties are stored as BigDecimal with Scale 0, but subsequent normalization changed it to scale 1. This made equals() return false when it shouldn't. This leads to calling notifyListenersAboutUpdatedElement unnecessarily.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
* [modbus] reduce log level when modbus slave returns DEVICE_BUSY exception
This exception is meant to indicate that the request should be retried
shortly, essentially, and at least some of the devices I own seem to be
busy bees. Thus my logs receive significant spam of this warning.
Since the exception is transient and retrying it is the expected course
of action, I think it makes sense to reduce the log level here slightly
and only output an error when the retries get exhausted.
Signed-off-by: Simonas Kazlauskas <git@kazlauskas.me>
* Update bundles/org.openhab.core.io.transport.modbus/src/main/java/org/openhab/core/io/transport/modbus/internal/ModbusManagerImpl.java
Signed-off-by: Simonas Kazlauskas <github@kazlauskas.me>
---------
Signed-off-by: Simonas Kazlauskas <git@kazlauskas.me>
Signed-off-by: Simonas Kazlauskas <github@kazlauskas.me>
Between Java 17 and Java 21, serialization of DateTime has changed due to
CLDR 42 which uses a narrow non-breaking space.
To ease switching JDK versions, the seralization format is explicitly
set to the Java 17 format.
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Previously it was not supporting paging. This validated correct
behaviour with historicState & lastUpdate & previousState
that have the pageSize defined.
Signed-off-by: Sami Salonen <ssalonen@gmail.com>
* Support Java 17 and 21, default compilation to Java 17 class files,
use maven.compiler.release instead of source and target
* Add profile "j21" to compile to Java 21 class files
* Upgrade SAT to 0.16.0, adapt code which breaks build with new SAT
checks
* Use model-specific-profile to pin xtend to Java 17
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* Script action: Allow script to be empty
* Short evaluate to reasonable defaults when script is empty
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
* Upgrade to Karaf 4.4.5 and Xtext 2.34
Upgrade Karaf from 4.4.4 to 4.4.5:
* Sync runtime dependencies with Karaf 4.4.5, most notably:
* Jetty 9.4.53.v20231009
* JNA 5.14.0
* Pax Logging 2.2.6
* Pax Web 8.0.24
* ASM 9.6
* Resolve itest runbundles
Upgrade Xtext from 2.32 to 2.34
* Sync depencencies, most notably:
* Guava 33.0.0
* classgraph 4.8.165 changing provider to io.github.classgraph
* Migrate old Xtext generator xtext.generator to xtext.xtext.generator
as xtext.generator has been removed from Xtext, affecting
org.openhab.core.model.lazygen
* resolve runbundles
* Remove org.openhab.core.model.lazygen
No longer in use since 2017, see eclipse-archived/smarthome#4122.
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* Contact item: Fix command descriptions provided even though commands are not accepted
If a state description is set on a contact item, currently a command description is automatically created as well.
This is wrong as contact items do not accept commands (except refresh) and caused the UI to display a control for the default (list) widget for these contacts.
* Also fix Call and Image items & Allow explicitly setting command description
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Fix two errors for calculating bitrate and duration of sound.
In AudioSinkUtilsImpl : confusion between byte / bite
In AudioWaveUtils : confusion between byte / bite AND with the defintion of framesize (framesize already includes channels number)
Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
* Upgrades jUPnP from 2.7.1 to 3.0.0.
* Uses a custom OSGiUpnpServiceConfiguration for JDK-8301341 workaround
For release notes, see:
https://github.com/jupnp/jupnp/releases/tag/3.0.0
Signed-off-by: Wouter Born <github@maindrain.net>
Data added from the REST API is immediately stored in the selected persistence service, bypassing the `PersistenceManager`. Because of that the future values are not correctly "restored".
Signed-off-by: Jan N. Klug <github@klug.nrw>
Allow a group to be a member of its direct parent and also its parent's ancestors without raising an error.
Looping membership is still detected and prevented as before, thus Stack Overflow is still avoided.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
* Script profile: Separate toHandlerScript for commands and states
This allows much more fine-grained control for the script profile.
E.g. it is now possible to mimic the behaviour of the `system:follow` profile, but apply a script transformation to the forwarded state.
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
If the specified key is not already associated with a value (or is mapped to null), the given mapping function computes the value.
Signed-off-by: Wouter Born <github@maindrain.net>
* Apply channel config changes in .items file
Changes in channel config weren't applied because ItemChannelLink.equals() include the link configurations in the comparison. This caused the new link not being found in the set lookup, which leads to erroneously calling notifyListenersAboutAddedElement, when it should've called notifyListenersAboutUpdatedElement instead.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Installing from marketplace gives an Error that is not very helpful.
Couldn’t find the widget in the add-on entry
The cause was missing ```yaml code fence when a normal code fence was used. This used to work in the past so a number of widgets are done this way and will not install. Suggest a more useful message to help guide widget devs.
Signed-off-by: Matthew Skinner <matt@pcmus.com>
* Replace Markdown backticks with JavaDoc code tags
The proper way to format code with JavaDoc is using code tags and not Markdown backticks.
Signed-off-by: Wouter Born <github@maindrain.net>
It has been reported several times that add-ons were not properly installed / missing after an upgrade or the installation of incompatible add-ons resulted in broken installations.
After an upgrade (or clean cache) the `AddonHandler`s try to re-install the add-ons from the download cache (`<userdata>/marketplace`). This happens without checking compatibility. This was needed before OH4, because the cache was the only source providing information about installed add-ons. This is now different, since we store the add-on information in a JSON database, so the UIDs of the add-ons are known.
This PR changes improves the add-on services. It now
1. Reads the information about the installed add-ons from the database and sets the installation status based on information from the handlers.
2. Removes all add-ons that are not installed from the JSON database and remembers their UIDs.
3. Refreshes the remote add-on list (including check for compatibility if not disabled).
4. Tries installation of the add-ons remembered in step 2. Since incompatible add-ons are missing in the add-on list, their installation fails and a warning is logged.
This PR is has two corresponding PR in openhab-distro and openhab-linuxpkg to ensure that the upgrade script and `openhab-cli` also clear the marketplace cache.
Signed-off-by: Jan N. Klug <github@klug.nrw>
Upgrades Jollyday 0.5.10 (de.jollyday) to 0.23.2 of a more actively maintained fork (de.focus-shift).
* This adds many missing holidays.
* Also removes the workaround for the Danish Great Prayer Day introduced by #3573.
For release notes, see:
https://github.com/focus-shift/jollyday/releasesFixes#3544
Signed-off-by: Wouter Born <github@maindrain.net>
* Fix Instant serialization/deserialization regression
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Consolidate serialization and deserialization in same type adapter
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Simplify deserializer
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
---------
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Abstract classes should not have public constructors.
Constructors of abstract classes can only be called in constructors of their subclasses.
So there is no point in making them public.
The protected modifier should be enough.
Signed-off-by: Wouter Born <github@maindrain.net>
* Simplify adding elements to Collections
This optimizes and simplifies the code that adds elements to Collections.
Signed-off-by: Wouter Born <github@maindrain.net>
* Iterate using Map entries
Iteration using Map entries is preferred because it is more efficient and helps preventing NPEs.
Signed-off-by: Wouter Born <github@maindrain.net>
A static inner class does not keep an implicit reference to its enclosing instance.
This prevents a common cause of memory leaks and uses less memory per instance of the class.
Signed-off-by: Wouter Born <github@maindrain.net>
* Simplify assertions
Using the appropriate assertion methods results in less and easier to read code as well as better error messages when assertions fail.
Signed-off-by: Wouter Born <github@maindrain.net>
An infinite recursion would occur when calling this method.
I did not find any add-ons using this method but that could be due to this bug.
Signed-off-by: Wouter Born <github@maindrain.net>
Removes redundant modifiers from the code.
These modifiers redeclare the default modifiers that apply to interfaces, enums etc.
Signed-off-by: Wouter Born <github@maindrain.net>
These array creations are unnecessary because arrays are created automatically for methods using varargs.
Signed-off-by: Wouter Born <github@maindrain.net>
`isEmpty()` expresses the intent more clearly and is therefore preferred.
Counting the number of elements can also be an expensive operation e.g. when using linked lists.
Signed-off-by: Wouter Born <github@maindrain.net>