Some bindings that dynamically create channels (mqtt.homie) might create
a channel that declares itself as Number:Dimensionless because the
end-device metadata has a unit of "%". But a savvy user might want to
link that to a Dimmer or Rollershutter item depending on what the device
actually is. This actually works just fine since QuantityType (with unit
PERCENT) and PercentType implicitly convert between each other. Except
this odd compatibility code in CommunicationManager that tries to assist
bindings that _aren't_ QuantityType compatible. It assumes if the channel's
item type is a dimensioned item, that the actual Item is a NumberItem,
and casts without checking. All this does is checks for that case to avoid
a ClassCastException.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* Add an add-on service that provides add-ons in the addons-folder
* fix connection and countries
This is needed to show the add-ons from the addons in the UI.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* Ensure metadata available at start-level 20
This makes the `MetadataRegistry` report when the elements of the `ManagedMetadataProvider` is available via a ready marker (like other registries).
Signed-off-by: Jan N. Klug <github@klug.nrw>
During startup most likely the item state is `UndefType.NULL` which results in no triggering. States are restored from persistence by directly setting the item state, not by an `ItemStateEvent` and were therefore missed. Since changing the trigger is not necessary when the state updates but does not change, the event listening was changed to `ItemStateChangedEvent` only.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* prevent a provider from removing an element from another provider
if multiple providers provide the same element, the added callback
simply ignores the duplicates. but the provider has no idea its element
was ignored, so it may try to remove it in the future, and things will
get all out of whack if the element is removed from the registry even
if another provider thinks it's still there
this is easily reproducible by creating an item in the UI, then
creating the same item via a .items file, and then removing the item
from the .items file. The item will seem like it is gone to most
of openHAB, but will come back after reboot when the managed
provider re-adds.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* Fix Marketplace add-on range pattern matching
With this fix it will use the correct string for pattern matching add-on version ranges introduced in #2811.
Signed-off-by: Wouter Born <github@maindrain.net>
The `AccessController` and the `SecurityManager` is deprecated for removal in Java 17. We don't make use of the `SecurityManager` anyway, so we can safely remove it.
Signed-off-by: Jan N. Klug <github@klug.nrw>
These wrong DataAmount units were added in #3208 for backwards compatibility.
In OH4 we can clean them up because this major version allows for breaking changes.
Signed-off-by: Wouter Born <github@maindrain.net>
* Raise source level to Java 17 (except for model classes)
* Remove Nashorn script engine
* Upgrade spotless and add jvm options
See https://github.com/diffplug/spotless/issues/834
* Add suppression for findBugs false positive error
* Upgrade xtext to 2.29.0
* Adjust JNA
* Resolve itests
Signed-off-by: Jan N. Klug <github@klug.nrw>
* New translations DefaultSystemChannels.properties (French)
* New translations restauth.properties (French)
* New translations voice.properties (French)
* Fix wrong websocket topics
The topics of the websocket event did not follow the openHAB convention of starting with `openhab/` followed by the component.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* [voice] Add notification sounds to dialog processor
* [audio] add actions and commands to play melodies
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>