* Fix ItemStateCondition for PercentType values
Dimmer items return their state as PercentType. The code did not properly handle PercentType because PercentType is a subclass of DecimalType. One value was converted by casting the value to DecimalType (which leads to 40 for 40%) while the other one used `.as` (which results in 0.4 for 40%). A comparison than of "state <= 50" with state = 20 is therefore executed as "20 <= 0.5" which is not what the user would expect.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* fix invertible unit conversions when sent via a binding
* do invertible unit conversion in ItemUIRegistry
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* Implement command completion in console for openhab command
And subcommands can implement it if they want. At the least the
CommandConsoleExtension's description will now be visible in
tab-completion.
I've also implemented detailed completion for openhab:items,
openhab:status, openhab:send, and openhab:update.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* Support mired units
Mired are fairly common to describe the color temperature of
lightbulbs (slightly less common than Kelvin), but are very
useful for various calculations when adjusting the color
temperature, as well as being necessary for various integerations
that require mired units.
This commit makes them a well-known unit (previously they were
still usable, using "MK^-1"), as well as making them easier to
work with on QuantityType. The hiccup is that Mireds aren't
technically a Temperature dimension, because they're a reciprocal.
So add a `inverse` method that delegates to javax.measure's
same method, and then use it as necessary when doing unit
conversions and comparisons. Unfortunately, because the
dimension changes, the return value of a conversion won't
necessarily be the same type, an additional method is added
for callers that are willing to handle the change in
dimension. This is implemented for all callers that can use
it in core.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* New translations automation.properties (Italian)
* New translations restauth.properties (German)
* New translations restauth.properties (Italian)
* New translations addons.properties (Italian)
* New translations restauth.properties (Danish)
* New translations restauth.properties (Finnish)
* New translations restauth.properties (Hungarian)
* New translations restauth.properties (Polish)
The docs say that JSR223 scripts will be loaded in order of start level
(as defined by filename or containing folder). this works (mostly) fine
when you're stepping through start levels sequentially on startup, but if
you're already at SL100, and have scripts located in sl folders, and then
install an addon for those scripts, they were loading in alphabetic
order instead. This ensures they'll still respect start level order
relative to each other.
This should also fix the case of script start levels not matching
start levels OpenHAB actually steps through (which are all multiples
of 10) - i.e. if you define scripts in sl30, sl31, and sl32, when
OpenHAB jumps from 30 to 40, 31 should be executed before 32.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
Unregistered trackers aren't clear, so then we never register new trackers,
and thus never get notified of any changes.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Cody Cutrer <cody@cutrer.us>
With these changes the proper translations file will be created.
The updated comments should prevent review comments and rework.
Signed-off-by: Wouter Born <github@maindrain.net>
* Fix missing initial thing status event
A thing always has a status. This status is not properly propagated to the event bus when the thing is added. This e.g. leads to a situation where a thing's first status that is received by am event subscriber is "INITIALIZING" instead of "UNINITIALIZED". The status should always be sent so that the thing lifecycle can properly be tracked by event listeners.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* Improve FeatureInstaller
* Remove unnecessary synchronized and clean up processing
* Re-add refeshing bundles after all configuratzion changes are processed
* Prevent unnecessary refreshes
* Make JNA part of the tp
Signed-off-by: Jan N. Klug <github@klug.nrw>
* [DateTimeTrigger] Adjust to system timeline
* [DateTimeTrigger] Add tests for DateTimeTriggerHandler
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
When changing to addon.xml later, this can be extended to all add-ons. It is necessary to improve the UI code for changing add-on log levels.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* New translations messages.properties (Danish)
* New translations audio.properties (Danish)
* New translations inbox.properties (Danish)
* New translations addons.properties (Danish)
* New translations persistence.properties (Danish)
* New translations lsp.properties (Danish)
* New translations sitemap.properties (Danish)
* New translations SystemThingStatusInfos.properties (Danish)
Instead of using the full id (`marketplace:123456`) the id without service prefix was used to lookup installed add-ons. This is not an issue if the network is available because then the information is request from the forum. If no network connection is present it obviously fails.
This also reduces the log level in the case of connection issues. ERROR is to much and the stack trace is not necessary.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* Enhance transformation configuration
This is needed to give the users the best experience when editing transformations in UI.
Signed-off-by: Jan N. Klug <github@klug.nrw>