Commit Graph

2161 Commits

Author SHA1 Message Date
Kai Kreuzer
b52ea9e73e
Prevent NPE in SseResource (#3194)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2022-12-03 20:07:29 +01:00
GiviMAD
e48902132a
[voice] Fix start dialog with non default voice (broken recently) (#3190)
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2022-12-03 15:13:03 +01:00
J-N-K
028724a73f
Add an access-tracking cache to be used in rules (#2887)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-12-02 09:47:00 +01:00
J-N-K
dc2f5d54f4
Fix transformRaw validation errors in DSL rules (#3178)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-30 23:12:12 +01:00
GiviMAD
d7f8ec2375
[voice] New voice manager dialog methods (#3142)
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2022-11-30 22:46:38 +01:00
Cody Cutrer
ff75505e70
Wrap ScriptEngine executions in a SafeCaller (#3180)
Fixes #3179

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-11-30 22:36:49 +01:00
Дилян Палаузов
f64874e226
Fix a/an typos (#3184) 2022-11-30 21:16:18 +01:00
dependabot[bot]
952b11560a
Bump jackson to 2.12.7(.1) (#3163)
* Bump jackson-databind from 2.12.6.1 to 2.12.7.1 in /bom/runtime

Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.12.6.1 to 2.12.7.1.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
...

Also-by: Wouter Born <github@maindrain.net>
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-30 19:36:30 +01:00
J-N-K
4bcc15daad
Refactor script dependency tracking (#3168)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-29 20:59:08 +01:00
Дилян Палаузов
e556fdf81b
Fix a/an typos (#3181)
* Typos a/an
* Fix typo generation in generateTagClasses.groovy

Signed-off-by: Wouter Born <github@maindrain.net>
2022-11-29 20:57:48 +01:00
Cody Cutrer
d96e5d5bc0
return the precise scheduled execution time for timers (#3182)
When writing tests and mocking time, it can be important that
execution_time match _exactly_ with what was sent to reschedule().
When re-calculating based on now and the expected remaining delay,
this might be off by a few milliseconds. We have the exact time
that was requested already, so might as well use it.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-11-29 18:25:53 +01:00
Cody Cutrer
af3738487c
add QuantityType.toUnitRelative (#3177)
this is a useful helper that can eliminate some complicated code elsewhere.
starting in SystemOffsetProfile. then I also want to use it in the homekit
addon.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-11-27 10:09:52 +01:00
Cody Cutrer
0cceb5b156
log full exception information when calling JSR223 scripts (#3176)
* log full exception information when calling JSR223 scripts

The scripts are user code, so in order to help them debug their code,
the full stack trace is very useful.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-11-27 09:28:36 +01:00
lolodomo
27b847f40c
Define format method for HSBType (#3165)
Pattern %s will match <hue>,<saturation>,<brightness>
Pattern %hsb% will match <hue>,<saturation>,<brightness>
Pattern %rgb% will match <red>,<green>,<blue>

Related to discussion in openhab/openhab-webui#427

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2022-11-26 16:00:54 +01:00
Cody Cutrer
f0875a46f2
tweak ScriptedRuleProvider slightly (#3170)
* tweak ScriptedRuleProvider slightly

just extend AbstractProvider so that it doesn't need to re-implement
managing listeners

Signed-off-by: Cody Cutrer <cody@cutrer.us>

* have ScriptedRuleProvider implement ManagedProvider

there's nothing that says ManagedProvider has to be backed by storage,
just that they should be able to add and remove elements

Since that's exactly what ScriptedRuleProvider does, might as well
have it conform to the interface.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-11-24 18:55:52 +01:00
J-N-K
f6e36c1852
[auromation] Fix createTimer for DSL rules (#3172)
* Fix createTimer for DSL rules

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-23 22:35:32 +01:00
Jacob Laursen
bf38f4d2b1
Clarify intention of beginDate/endDate in persistence extensions (#3164)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2022-11-21 17:13:05 +01:00
J-N-K
d00d14d9fc
Add default units for all dimensions (#3143)
* Add default units for all dimensions

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-19 23:10:38 +01:00
J-N-K
4f35d474fc
Strip unit if NumberItem has no dimension (#3153)
* Strip unit if NumberItem has no dimension

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-19 23:05:55 +01:00
J-N-K
c340e8db6c
Refactor ScriptExecution to plain Java ScriptExtension (#3155)
* Refactor ScriptExecution to plain Java ScriptExtension
* keep callScript backward compatible

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-19 20:29:58 +01:00
GiviMAD
06c0e90535
[auth] Fix wrong parameter on AuthorizePageServlet (#3154)
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2022-11-13 11:08:58 +01:00
dependabot[bot]
440ce2eb6c
Bump ivy from 2.5.0 to 2.5.1 in /bundles/org.openhab.core.semantics (#3152)
Signed-off-by: dependabot[bot] <support@github.com>
2022-11-13 10:53:58 +01:00
J-N-K
64a31026cd
Add unmanaged scripts to rule engine (#3156)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-13 10:50:42 +01:00
J-N-K
d4ceca9fe0
Fix config normalization in ThingUpdatedEvent (#3157)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-13 10:44:30 +01:00
J-N-K
2bceba6954
Fix missing stateDescriptionProvider in Group items (#3144)
* Fix missing stateDescriptionProvider in Group items

The stateDescriptionProvider was not properly passed to the base item. Because of that units set in the state description were not properly used when setting the group state after calculating aggregation functions.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-11-06 20:50:05 +01:00
GiviMAD
9cdaa48fa5
[voice] Allow stopping single dialogs and start dialog on an existing processor (#3100)
* [voice] Allow stop single dialogs and start processing on an existing one

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2022-11-05 13:16:53 +01:00
Sami Salonen
18d063e272
Avoid parallel streams with common thread pool to avoid deadlocks (#3137)
* Avoid parallel streams with common thread pool to avoid deadlocks

To mitigate issue #3125

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
2022-11-01 20:05:54 +01:00
Cody Cutrer
221c80b12f
Change system.color-temperature-abs channel type to be a Number:Temperature (#3129)
refs https://github.com/openhab/openhab-addons/pull/13570#issuecomment-1288139778

now that Kelvin and mireds/mireks are easily convertible

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-11-01 09:50:01 +01:00
Cody Cutrer
3d279eb7f1
[mqtt] Properly process retained messages (#3124)
* [mqtt] Properly process retained messages

Only the _first_ message has the retained flag (always on MQTT3,
there is a flag to forward the retain flag on all messages with
MQTT5, but we don't set it), so we have to keep track of previously
retained messages as well.

This shows up as when a thing comes back online and re-subscribes
to a retained message that another thing subscribed to also,
it won't see any changes that happened to that topic since the
very first message was received.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-11-01 09:23:01 +01:00
J-N-K
d871066efc
Add DateTime handling to ItemStateConditionHandler (#3138)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-10-31 22:59:30 +01:00
J-N-K
d9bf8f7a15
[rest] add semantics query endpoint to item resource (#2985)
* [rest] add semantics query to item resource

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-10-30 15:50:36 +01:00
J-N-K
c24f0f3c6f
[automation] Fix ItemStateCondition for PercentType values (#3136)
* 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>
2022-10-29 13:17:48 +02:00
Cody Cutrer
a7d912d1e9
Fix invertible unit conversions when sent via a binding or uses in ItemUIRegistry (#3134)
* fix invertible unit conversions when sent via a binding
* do invertible unit conversion in ItemUIRegistry

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-10-27 20:26:27 +02:00
Cody Cutrer
e86f388a5b
Implement command completion in console for openhab command (#3111)
* 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>
2022-10-22 10:52:31 +02:00
openhab-bot
73737e255a
New translations restauth.properties (Hebrew) (#3118) 2022-10-22 10:47:32 +02:00
Cody Cutrer
ccdf2c5573
Allow sending IncreaseDecreaseType directly to DimmerItem (#3116)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-10-17 08:05:02 +02:00
Cody Cutrer
3659542bae
Support mired units (#3108)
* 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>
2022-10-16 13:50:46 +02:00
Cody Cutrer
7f38d419c6
Allow sending QuantityType to NumberItem (#3115)
NumberItems always accept QuantityType

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-10-15 09:31:30 +02:00
openhab-bot
07be655b0e
New Crowdin updates (#3109)
* 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)
2022-10-15 09:27:02 +02:00
Christoph Weitkamp
389979c9da
Add more basic time-related classes for usage in script and rules (#3113)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2022-10-15 09:26:10 +02:00
J-N-K
ef3b13fce8
Fix AuthFilter crash if trusted network not configured (#3110)
* Fix AuthFilter crash if trusted network not configured

Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-10-13 08:09:23 +02:00
GiviMAD
3ba0b8cf6d
[auth] grant implicit user role by network address (#3106)
* [auth] grant implicit user role by network

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
2022-10-10 19:57:31 +02:00
openhab-bot
4096df1c64
New translations DefaultSystemChannels.properties (Norwegian) (#3098) 2022-10-05 18:44:21 +02:00
Cody Cutrer
5062ab5fb0
[rulesupport] sort JSR223 scripts by start level before filename (#3099)
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>
2022-10-05 18:43:48 +02:00
Christoph Weitkamp
93a8a214cf
Use Timer identifier when rescheduling the timer (#3095)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2022-09-29 14:05:09 +02:00
J-N-K
6d6250eb63
[transformation] Add swp to ignored extensions in FileTransformationProvider (#3094)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-09-27 18:32:19 +02:00
Dan Cunningham
b808ea6d13
Add live packet to SSE item state connections (#3086)
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
2022-09-26 19:09:33 +02:00
Cody Cutrer
065e33f5ab
Fix StartLevelService "hanging" if config is changed. (#3092)
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>
2022-09-25 09:44:57 +02:00
openhab-bot
92105d9a28
New translations DefaultSystemChannels.properties (Italian) (#3088) 2022-09-23 18:16:28 +02:00
Wouter Born
7b0b70ca4a
Improve binding archetype for Crowdin usage (#3089)
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>
2022-09-23 18:15:50 +02:00