Commit Graph
100 Commits
Author SHA1 Message Date
Florian HotzeandGitHub 12e472ac9d [mqtt.homeassistant] Fix itest dependencies (#18752)
* [mqtt.homeassistant] Fix itest dependencies

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-06-03 21:47:51 +02:00
Florian HotzeandGitHub 7d6046762e [jsscripting] Upgrade openhab-js to 5.11.1 (#18703)
This includes a fix for a regression from 5.11.0.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-05-21 16:51:40 +02:00
Florian HotzeandGitHub f7c5617735 [jsscripting] Upgrade openhab-js to 5.11.0 (#18688)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-05-16 12:09:10 +02:00
Florian HotzeandGitHub e251461db3 [froniuswattpilot] Initial contribution (#18471)
* [froniuswattpilot] Add initial version of new binding

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-05-09 17:54:25 +02:00
Florian HotzeandGitHub 6e5da3abab [jsscripting] Fix bundled resources not found on windows (#18562)
Regression from #18500.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-04-16 23:05:33 +02:00
Florian HotzeandGitHub 078463be22 [jsscripting] Update default translation (#18503)
Follow up for #18500.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-04-08 22:06:17 +02:00
Florian HotzeandGitHub a4222250fb [jsscripting] Code improvements (#18500)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-04-08 20:15:07 +02:00
Florian HotzeandGitHub 3b64968ed5 [jsscripting] Upgrade to openhab-js 5.10.0 (#18489)
For changelog, see https://github.com/openhab/openhab-js/blob/main/CHANGELOG.md#5100.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-04-06 10:28:03 +02:00
Florian HotzeandGitHub 5e648a72ee [jsscripting] Upgrade GraalJS to 24.2.0 (#18421)
Depends on https://github.com/openhab/openhab-osgiify/pull/59.

Changelog: https://github.com/oracle/graaljs/blob/master/CHANGELOG.md#version-2420

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-03-22 18:33:51 +01:00
Florian HotzeandGitHub 8a7504f800 [jsscripting] Upgrade openhab-js to 5.9.0 (#18406)
See https://github.com/openhab/openhab-js/blob/main/CHANGELOG.md#590 for changes.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-03-18 22:05:16 +01:00
Florian HotzeandGitHub a766c729d0 [fronius] Add myself as code owner (#18378)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-03-11 22:35:46 +01:00
Florian HotzeandGitHub f2b0d89c51 [fronius] Fix bridge config update not properly handled (#18375)
Fixes #18123.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-03-11 20:34:51 +01:00
Florian HotzeandGitHub 9add6676f3 [airparif] Remove missing image from README (#18319)
This is a hotfix for the website build.
2025-02-23 20:24:21 +01:00
Florian HotzeandGitHub 8c68fb706e [jsscripting] Use OSGi-ified GraalVM dependencies (#18053)
* [jsscripting] Use OSGI-ified org.graalvm.sdk:* dependencies

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-02-13 09:23:05 +01:00
Florian HotzeandGitHub a4ac0217c4 [fronius] Document how to set username/password in .things file (#18234)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-02-06 15:06:31 +01:00
Florian HotzeandGitHub 76e4db24ee [fronius] Support setting backup reserved battery capacity (#18080)
* [fronius] Add action to set reserve battery capacity

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-01-22 15:53:31 +01:00
Florian HotzeandGitHub d0b918e448 [fronius] Verify battery control time of use successfully set (#18131)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-01-19 22:01:05 +01:00
Florian HotzeandGitHub 8f77e16e18 [fronius] Fix invalid credentials lead to unexpected exception (#18130)
With the changes from this PR, the status code is now properly read and for 401, a meaningful warnings is logged instead.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2025-01-19 17:05:38 +01:00
Florian HotzeandGitHub 5e7d2fc5da [jsscripting] Upgrade GraalJS from 22.0.0.2 to 24.1.1 (#17720)
* [jsscripting] Upgrade GraalJS to 23.0.6

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-12-22 08:09:09 +01:00
Florian HotzeandGitHub 9b4ee482ab [jsscripting] Upgrade openhab-js to 5.8.1 (#17885)
Changelog: https://github.com/openhab/openhab-js/blob/main/CHANGELOG.md#581.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-12-11 16:48:05 +01:00
Florian HotzeandGitHub fc478a7114 [jsscripting] Upgrade openhab-js to 5.8.0 & Add note to check core fix on on upgrade (#17703)
* [jsscripting] Upgrade to openhab-js 5.8.0

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-11-05 21:16:43 +01:00
Florian HotzeandGitHub fcb12d612a [jsscripting] Upgrade openhab-js to 5.7.1 (#17667)
Changelog: https://github.com/openhab/openhab-js/blob/main/CHANGELOG.md#571.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-10-29 22:35:29 +01:00
Florian HotzeandGitHub 7f256a768a [fronius] Thing actions: Return boolean & Annotate all inputs as required (#17623)
* [fronius] Symo Inverter actions: Return boolean to indicate success/failure
* [fronius] Symo Inverter actions: Annotate all inputs as required
* [fronius] Add `@ActionOutput` annotation

As discussed in #17504.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-10-29 22:34:11 +01:00
Florian HotzeandGitHub abe819978f [jsscripting] Remove Thread.sleep workaround for multi-threading issues with UI-based scripts (#17630)
Follow-up for #1710.
Depends on https://github.com/openhab/openhab-core/pull/4426.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
2024-10-26 23:27:41 +02:00
Florian HotzeandGitHub e6056d3142 [jsscripting] Fix multi-threading issues in UI-based scripts (#17510)
* [jsscripting] Make logger non-static
* [jsscripting] Log lock acquisition and release
* [jsscripting] Implement Lock in DebuggingGraalScriptEngine so openHAB Core can lock and unlock when executing the pre-compiled script
* [jsscripting] Improve comments in ThreadsafeTimers
* [jsscripting] Add a short sleep after unlocking the lock to fix multi-threading issues with UI-based scripts

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-10-24 19:04:34 +02:00
Florian HotzeandGitHub 856d526d95 [jsscripting] Synchronize context access in logger initialization (#17496)
* [jsscripting] Synchronize context access in logger initialisation to avoid illegal multi-thread access
Fixes #17494.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-10-02 22:53:49 +02:00
Florian HotzeandGitHub 19c18be297 [jsscripting] Upgrade openhab-js to 5.7.0 (#17441)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-09-19 23:36:25 +02:00
Florian HotzeandGitHub 8fb03da095 [jsscripting] Upgrade to openhab-js 5.6.0 (#17424)
Also sync webpack dependency with openhab-js package.json.

* [jsscripting] README changes from ohjs upgrade

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-09-16 12:28:46 +02:00
Florian HotzeandGitHub 63efac653c [fronius] Fix warning box in README (#17401)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-09-10 18:59:31 +02:00
Florian HotzeandGitHub e18192f7cc [jsscripting] Upgrade to openhab-js 5.5.0 (#17311)
See https://github.com/openhab/openhab-js/blob/main/CHANGELOG.md#550 for changelog.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-08-22 22:56:12 +02:00
Florian HotzeandGitHub bfce4b28f9 [fronius] Add battery control Thing actions (#17170)
* [fronius] Add DTOs for /config/timeofuse HTTP endpoint

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-07-30 09:01:39 +02:00
Florian HotzeandGitHub 20251feb09 [jsscripting] Fix console logger name & timer identifier missing for UI scripts (#17171)
* [jsscripting] Fix console logger name is missing for UI scripts
* [jsscripting] Fix timer identifier "missing" for setTimeout/setInterval for UI scripts

Fixes #17165.
Caused by https://github.com/openhab/openhab-core/pull/4289.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-07-29 17:07:29 +02:00
Florian HotzeandGitHub 9ae9adf6f6 [jsscripting] ThreadsafeTimers: Add overrides for double delay for setTimeout & setInterval (#17148)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-07-25 23:10:27 +02:00
Florian HotzeandGitHub 1fedd7ad42 [fronius] Improve package structure & Enhance null annotations/handling (#17109)
* [fronius] Restructure DTOs & Improve null annotations/handling

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-07-25 09:47:22 +02:00
Florian HotzeandGitHub 405f4023ee [jsscripting] Implement javax.script.Compilable (#16970)
* [jsscripting] Restructure & Comment POM
* [jsscripting] Use OPENHAB_TRANSFORMATION_SCRIPT constant from core

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-07-09 20:08:30 +02:00
Florian HotzeandGitHub 5487b9c05d [jsscripting] Fix notification builder examples (#16999)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-07-05 10:50:39 +02:00
Florian HotzeandGitHub 2d412023a9 [jsscripting] Upgrade to openhab-js 5.3.1 (#16985)
Depends on #16979.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-07-04 14:07:21 +02:00
Florian HotzeandGitHub 7475e5d1d7 [openhabcloud] Further README improvements (#16942)
Also-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-06-28 22:13:24 +02:00
Florian HotzeandGitHub 001dd6aba7 [jsscripting] Upgrade openhab-js to 5.3.0 (#16951)
This adds the new notification builder.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-06-28 19:15:49 +02:00
Florian HotzeandGitHub 9a6258b405 [openhabcloud] Update README for new notification features (#16941)
* [openhabcloud] Update README for new notification features

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-06-26 22:09:45 +02:00
Florian HotzeandGitHub 6ccaf813e6 [jsscripting] Upgrade openhab-js to 5.2.0 (#16935)
Adds support for https://github.com/openhab/openhab-core/pull/4259.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-06-25 20:47:15 +02:00
Florian HotzeandGitHub 20b5e1c20e [jsscripting] Upgrade openhab-js to 5.1.2 (#16926)
Second attempt to fix a problem, where persisting TimeSeries failed when injection caching was enabled.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-06-23 19:39:25 +02:00
Florian HotzeandGitHub 588aac4eba [jsscripting] Upgrade openhab-js to 5.1.1 (#16892)
Fixes a problem, where persisting TimeSeries failed when injection caching was enabled.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-06-19 14:20:31 +02:00
Florian HotzeandGitHub 53fa23b957 [jsscripting] Upgrade openhab-js to 5.1.0 (#16881)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-06-16 20:33:50 +02:00
Florian HotzeandGitHub 42c297a0ee [jsscripting] Upgrade openhab-js to 5.0.0 (#16719)
See https://github.com/openhab/openhab-js/blob/main/CHANGELOG.md#500.

Required to adjust to breaking changes from https://github.com/openhab/openhab-core/pull/3736.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-05-05 22:57:06 +02:00
Florian HotzeandGitHub ebb0f54dbd [openweathermap] Prepare for shutdown of One Call API version 2.5 (#16705)
* [openweathermap] Update README for shutdown of One Call API version 2.5 & Change default API version

Closes #16665.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-04-30 14:05:50 +02:00
Florian HotzeandGitHub 66e8d7dc94 [jsscripting] Fix memory leak on script execution failure (#16578)
Make engineIdentifier a instance field to ease debugging.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-27 21:43:07 +01:00
Florian HotzeandGitHub 3ca4b4f749 [jsscripting] Upgrade to openhab-js 4.9.0 (#16576)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-25 21:11:24 +01:00
Florian HotzeandGitHub 6139368d83 [jsscripting] Fix multi-thread access requested by logger initialization (#16497)
* [jsscripting] Fix multi-threading issue with logger initialization

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-07 18:49:34 +01:00
Florian HotzeandGitHub df7a57af96 [jsscripting] Improve logging on JS error (#16445)
* [jsscripting] Improve script error logging
* [jsscripting] Suppress some warnings
* [jsscripting] Throw ISE instead of RE
* [jsscripting] Minor null annotation improvements

Include fileName or ruleUID or transformation UID in the logger name used by the logged error stack trace.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-02-25 00:39:57 +01:00
Florian HotzeandGitHub d15fe90f48 [sungrow] Change image file extension to fix website build (#16450)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-02-23 22:58:58 +01:00
Florian HotzeandGitHub 64801798d8 [openweathermap] Finish clean-up & Fix OneCall Forecast Thing channel creation (#16416)
* [openweathermap] Clean-Up config.xml

Remove config description for removed UV Index Thing.

* [openweathermap] Fix OneCall Thing creates to many channels

The default setting is to create 0 minutes, 12 hours and 6 days of forecast channels.
When creating a new OneCall Thing, actually 60 minutes, 24 hours and 8 days of forecast were created due to the thing-types, but those not needed (as determined by the configuration) were not removed.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-02-18 00:12:21 +01:00
Florian HotzeandGitHub 1bb62c450c [openweathermap] Code clean-up (#16369)
* [openweathermap] Remove UV Index Thing

The UV Index API has been retired on 1st April 2021 and replaced by OneCall API 3.0.
Therefore, this Thing is not working anymore and can be removed from the source code.

* [openweathermap] Clean-Up DTOs

- Improve class JavaDoc.
- Remove setters as they are not needed. (All OWM APIs get required the data as query params.)

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-02-15 14:29:51 +01:00
Florian HotzeandGitHub c9926ccc47 [jsscripting] Upgrade openhab-js to 4.8.1 (#16353)
* [jsscripting] Upgrade openhab-js to 4.8.0

Changelog: https://github.com/openhab/openhab-js/blob/main/CHANGELOG.md#480

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-02-01 10:22:09 +01:00
Florian HotzeandGitHub 4870083c76 [yamahamusiccast] Add discovery information (#16231)
* [yamahamusiccast] Add discovery information

Seems like Yamaha is using uppercase `YAMAHA CORPORATION` for the manufacturer info of non-MusicCast devices and normal case `Yamaha Corporation` for MusicCast devices.

* [yamaha] Fix REGEXes for Yamaha binding suggestion and improve description

---------

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-01-19 19:39:12 +01:00
Florian HotzeandGitHub 6540d0dda9 [jsscripting] Upgrade openhab-js to 4.7.3 (#16112)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-12-25 23:52:59 +01:00
Florian HotzeandGitHub 20a6eee4b5 [jssscripting] Fix JS Quantity to Java QuantityType conversion (#16106)
Regression from https://github.com/openhab/openhab-js/pull/312.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-12-25 15:09:00 +01:00
Florian HotzeandGitHub 7d7acb5dbf [jsscripting] Upgrade openhab-js to 4.7.2 (#16072)
Fixes a minor issue introduced by openhab-js 4.7.1.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-12-17 12:17:38 +01:00
Florian HotzeandGitHub 63d71f4865 [jsscripting] Upgrade openhab-js to 4.7.1 (#16069)
You'll find the changelog at the openhab-js repo: https://github.com/openhab/openhab-js/blob/main/CHANGELOG.md#471.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-12-16 13:50:41 +01:00
Florian HotzeandGitHub 7b16ef1de8 [jsscripting] Upgrade openhab-js to 4.7.0 (#16062)
You'll find the changelog at the openhab-js repo: https://github.com/openhab/openhab-js/blob/main/CHANGELOG.md#470.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-12-14 20:23:37 +01:00
Florian HotzeandGitHub c81a263b91 [openweathermap] Add support for persisting OneCall API forecasts (#15963)
Implement time series support introduced by https://github.com/openhab/openhab-core/pull/3597.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-12-14 20:21:54 +01:00
Florian HotzeandGitHub 7e1f4b0e1c [persistence] Capitalize add-on names (#15378)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-10-10 14:04:21 +02:00
Florian HotzeandGitHub 99f0512c73 [jsscripting] Rename library injection parameter & Improve docs (#15547)
* [jsscripting] Rename parameter useIncludedLibrary to injectionCachingEnabled (#4)
* [jsscripting] Improve README for cached library injection
* Remove settings image

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-09-26 22:59:20 +02:00
Florian HotzeandGitHub 6e349334e4 [jrubyscripting] Allow configuration from add-on page (#15438)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-08-16 21:49:20 +02:00
Florian HotzeandGitHub bf7f24c099 [jsscripting] Upgrade openhab-js to 4.5.1 to fix cached injection (#15336)
It was found out that a recent change to the webpack config for the library injection bundle heavily affected performance of the evaluation of the cached injection.

openhab-js 4.5.1 fixes that regression and one minor bug, see https://github.com/openhab/openhab-js/blob/main/CHANGELOG.md#451.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-07-30 14:47:03 +02:00
Florian HotzeandGitHub e1c9213cfc [jsscripting] Fix timerId not returned by JS timer methods (#15308)
Regression from #15193.
Reported on the community, see https://community.openhab.org/t/openhab-4-0-release-discussion/147957/53?u=florian-h05.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-07-26 16:28:46 +02:00
Florian HotzeandGitHub 72c0e1f29f [jsscripting] Upgrade openhab-js to 4.5.0 (#15219)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-07-10 23:15:04 +02:00
Florian HotzeandGitHub 2d75536f48 [jsscripting] Implement NodeJS-like parameter handling for timer polyfills (#15193)
* [jsscripting] Implement NodeJS-like param handling for timer polyfills
* [jsscripting] Clean-Up ThreadsafeTimer methods

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-07-07 23:10:35 +02:00
Florian HotzeandGitHub 6dff1ffa63 [yamahamusiccast] Fix DecimalType commands for volumeDB channel (#15124)
* [yamahamusiccast] Fix volumeDB channel doesn't accept DecimalType and QuantityType commands

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-06-25 12:14:58 +02:00
Florian HotzeandGitHub 828c895b54 [jsscripting] Bump openhab-js version to 4.4.0 (#15128)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-06-20 15:40:11 +02:00
Florian HotzeandGitHub 095a5df323 [evcc] Adjust to API changes & Add new channels for evcc 0.117.0 (#14983)
* [evcc] Remove `hasVehicle` channel
* [evcc] Update API for evcc 0.117.0
* [evcc] Fix targetSoC and targetTime not working

Also:
- Use new Java 17 features.

Fixes #14348.

* [evcc] Add `targetEnergy` channel
* [evcc] Make `batteryPrioritySoC` channel writable

Closes #14347.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-21 21:21:38 +02:00
Florian HotzeandGitHub aa3d6b0dc9 [jsscripting] Add type translation for Instant & Minor improvements (#14984)
* [jsscripting] Minor code improvements
* [jsscripting] Add type mapping for `Instant`
* [jsscripting] Upgrade openhab-js to 4.3.0

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-13 12:25:06 +02:00
Florian HotzeandGitHub 03b305bde2 [jsscripting] Bump openhab-js to 4.2.1 (#14749)
* [jsscripting] Upgrade openhab-js to 4.2.1
* [jsscripting] Note that it is based on GraalJS

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-04-06 15:50:09 +02:00
Florian HotzeandGitHub 726858b4f1 [jsscripting] Upgrade openhab-js to 4.1.0 (#14495)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-02-25 10:18:49 +01:00
Florian HotzeandGitHub ce2e76d6ee [jsscripting] Bump openhab-js to 4.0.0 & Clean-Ups (#14375)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-02-14 21:19:59 +01:00
Florian HotzeandGitHub d2db49ff67 [jsscripting] Extend mapping of openhab-js classes to native openHAB counterparts (#14335)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-02-12 11:53:51 +01:00
Florian HotzeandGitHub 988fde1aba [evcc] Fixes & Adjust to more breaking changes from evcc 0.111.x (#14381)
* [evcc] Adjust DTO for renamed activePhases
* [evcc] Correct wrong units for capacities
* [evcc] Fix wrong getter & Reformat

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-02-10 23:55:23 +01:00
Florian HotzeandGitHub f808edf725 [evcc] Adjust to breaking API change & Add new channel (#14245)
* [evcc] Adjust to breaking API changes

Fixes #14231.

See https://github.com/evcc-io/evcc/discussions/5522.

* [evcc] Add battery capacity channel
* [evcc] Version & openHABian note
* [evcc] Use already defined constants in ChannelTypeUIDs
* [evcc] Correct header in evcc.properties

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-01-23 21:17:39 +01:00
Florian HotzeandGitHub 80094b5e9d [influxdb] Add docs for usage of self-signed certs (#14228)
* [influxdb] Add docs for usage of self-signed certs

See
https://community.openhab.org/t/influxdb-persistence-doesnt-work-with-s
sl/35409/10?u=florian-h05.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-01-15 23:55:42 +01:00
Florian HotzeandGitHub b91fc94bdb [jsscripting] Update docs for code caching (#14166)
... and fix the table of contents.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-01-05 23:04:07 +01:00
Florian HotzeandGitHub 1548f16f5e [hueemulation] Fix tests after core change (#14161)
Fixes #14153.
This fixes the Hue Emulation tests (and in consequence the full addons build) after core change https://github.com/openhab/openhab-core/pull/3298.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-01-05 13:28:28 +01:00
Florian HotzeandGitHub f082df923f [jsscripting] Fix regressions from #14135 & Log stack on IllegalArgumentException (#14142)
* [jsscripting] Fix bundling of global script & regression from #14135

Fixes the regression from https://github.com/openhab/openhab-addons/pull/14135#issuecomment-1369231126.

While working on this, I also noticed that the cache openhab-js does not work because of wrong webpack commandline args in the pom (wrong entrypoint).

* [jsscripting] Enable stack logging for IllegalArgumentExceptions
* [jsscripting] Upgrade openhab-js to 3.2.4
* [jsscripting] Update README for recent PR

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-01-03 20:45:23 +01:00
Florian HotzeandGitHub 3c669ad77a [jsscripting] Cache openhab-js injection to improve performance (#14135)
* [jsscripting] Extend comments for wraprequire
* [jsscripting] Enable openhab-js caching to improve performance

On my dev system (which I guess is much more powerful than most openHAB servers), cached openhab-js injection takes 100-200 ms.
openhab-js injection from file system takes about 1000 ms.

* [jsscripting] Update configuration language
* [jsscripting] Upgrade openhab-js version to 3.2.1 for required webpack changes

Documentation updates will follow in another PR to keep this one clean.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-01-02 20:41:35 +01:00
Florian HotzeandGitHub 23cfec7684 [jsscripting] Improve performance & reduce memory usage (#14113)
* [jsscripting] Share org.graalvm.polyglot.Engine across all OpenhabGraalJSScriptEngine instances

See https://github.com/oracle/graaljs/issues/121#issuecomment-880056648, it is not required to have one engine per GraalJSScriptEngine.

This might improve performance a bit on less powerful systems (Raspberry Pi) and decreases heap usage:
With 5 GraalJS UI scripts, heap usage is now below 100 MB. Before this change, it was over 100 MB.

* [jsscripting] Extend debug logging
* [jsscripting] Cache `@jsscripting-globals.js` across all engines

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-30 23:34:35 +01:00
Florian HotzeandGitHub 931f004ab8 [jsscripting] Upgrade to ECMAScript 2022 & Dependency improvements (#14093)
* [jsscripting] Remove asm from dependencies in pom

GraalJS >= 20.3.0 doesn't require org.ow2.asm as compile dependency anymore, see https://mvnrepository.com/artifact/org.graalvm.js/js/20.3.0.

* [jsscripting] Remove dependency org.graalvm.js/js-launcher as it is not required

js-launcher is GraalVM's JavaScript command line interpreter and not required in the addon.
See https://www.graalvm.org/22.1/reference-manual/js/RunOnJDK/.

* [jsscripting] Add missing com.ibm.icu dependency

GraalJS changelog says that it is not required for GraalJS >= 22.0.0 (see https://github.com/oracle/graaljs/blob/685e5873af80a59636b697c949a172d8a7d694c3/CHANGELOG.md#version-2200).
But GraalJS 22.3.0 attempts to load classes from it during runtime.

* [jsscripting] Update GraalJS engine options

Compat, as its additional functionality is not used by openhab-js and user code is not expected to use it.

* [jsscripting] Remove com.ibm.icu/icu4j dependency
* [jsscripting] Don't disable Nashorn compat mode as openhab-js requires it for accessors

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-30 23:04:43 +01:00
Florian HotzeandGitHub 895defda8e [jsscripting] Use application/javascript as MIME type (#14096)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-29 21:01:22 +01:00
Florian HotzeandGitHub 4d98cca7eb [jsscripting] Minor fixes & improvements (#13960)
* [jsscripting] Correct wrong `createScriptEngine` implementation
* [jsscripting] Also unlock lock on unexpected exceptions (rethrow them)
* [jsscripting] Call super methods from their overrides
* [jsscripting] Move superclass call of `beforeInvocation`

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-20 09:15:43 +01:00
Florian HotzeandGitHub 15e6bebb6c [yamaha] README: Recommend correct binding for specific model (#13985)
This doc improvement tries to avoid future issue like #10838.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-17 15:42:23 +01:00
Florian HotzeandGitHub 11e2c4fc31 [jsscripting] Update add-on name in default translation (#13984)
Leftover from #13764.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-17 13:40:12 +01:00
Florian HotzeandGitHub d4ec220925 [jsscripting] Extend synchronization to common ScriptEngine methods (#13924)
* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to https://github.com/openhab/openhab-core/pull/3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e45879c10aad29bf279ddbb0afd789b0aa.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to https://github.com/openhab/openhab-core/pull/3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-14 20:12:54 +01:00
Florian HotzeandGitHub 438552d485 [jsscripting] Upgrade openhab-js & Remove SharedCache (#13908)
Upgrades the included openhab-js version to 3.1.0, which uses the new
caches from core (introduced in
https://github.com/openhab/openhab-core/pull/2887) and provides many
doc improvements.

Removes the SharedCache from the addon because this functionality is
now provided by core (see
https://github.com/openhab/openhab-core/pull/2887).

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-11 15:25:39 +01:00
Florian HotzeandGitHub a9d4244fd8 [jsscripting] Fix "Error removing engine" context already closed (#13855)
In recent PR #13824, I added closing the context when the engine is closed, but core seems to have problems with that.

It logs: "[ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error removing ScriptEngine
java.lang.IllegalStateException: The Context is already closed."

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-06 13:15:47 +01:00
Florian HotzeandGitHub bf48eccf8c [jsscripting] Refactor log formatting & Respect toString polyfills (#13844)
* [jsscripting] Refactor log formatting & Respect toString polyfills
* [jsscripting] Catch errors in log formatting & Improve handling of Java obj
* [jsscripting] Update log format failure message

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-05 20:46:17 +01:00
Florian HotzeandGitHub 54b2772df4 [jsscripting] Add an alternative MIME type/alias (#13851)
The alternative MIME type text/javascript is also used by Nashorn, therefore we add the same extension as for the main MIME type.
The alias is introduced to simplify the usage in SCRIPT transformation profiles.

* Fix syntax problems in the bndtools file
* Add null check to avoid potential NPE
  In some cases during testing, a NPE occured, this should solve it.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-05 18:40:15 +01:00
Florian HotzeandGitHub 42b8505bef [jsscripting] Fix memory leak that crashes openHAB (#13824)
* [jsscripting] Fix memory-leak caused by com.oracle.truffle.host.HostObject

Fixes this memory leak by making the HostAccess for the GraalJSScriptEngine available in a static final variable instead of creating it for each new engine.
Solution proposed in https://github.com/oracle/graaljs/issues/121#issuecomment-690179954.

Sharing a single engine across all Contexts (as proposed in https://github.com/oracle/graaljs/issues/121#issuecomment-880056648) is not possible, because core expects a ScriptEngine.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* [jsscripting] Update JavaDoc

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* [jsscripting] Close `GraalJSScriptEngine` when `OpenhabGraalJSScriptEngine` is closed

My breakpoint inside the close method of GraalJSScriptEngine did not trigger until this change was made.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-03 00:17:39 +01:00
Florian HotzeandGitHub 446be35ac5 [evcc] Extend accepted types for commands & Handle quantity types of commands (#13795)
* [evcc] Extend accepted command types
* [evcc] Convert QuantityType commands to required units
* [evcc] Allow evcc URL to end with a slash

Should fix an issue on the forum, where a user sent a command of DecimalType, but the binding expected a QuantityType.
See https://community.openhab.org/t/evcc-binding-electric-vehicle-charging-control/135209/15.
The accepted command types are extended for all channels if possible.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-11-28 22:17:26 +01:00
Florian HotzeandGitHub 29d2578981 [jsscripting] Fix add-on name in feature/pom (#13764)
* Update pom.xml
* Update feature.xml
* [jsscripting] Rename from JSScripting to JavaScript Scripting

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-11-24 23:23:19 +01:00
bfff07bb01 [jsscripting] Reimplement timer creation method of ScriptExecution (#13695)
* [jsscripting] Refactor ThreadsafeTimers to create futures inline instead of in an extra methods
* [jsscripting] Introduce utility class for providing easy access to script services
* [jsscripting] Reimplement timer creation methods from ScriptExecution for thread-safety
* [jsscripting] Add missing JavaDoc for reimplement timer creation methods
* [jsscripting] Remove the future from the map when setTimeout expires
* [jsscripting] Rename `GraalJSScriptServiceUtil` to `JSScriptServiceUtil`
* [jsscripting] Remove the `createTimerWithArgument` method
* [jsscripting] Replace the OSGi workaround of `JSScriptServiceUtil` with an injection mechanism
* [jsscripting] Use constructor to inject `JSScriptServiceUtil` into `GraalJSScriptEngineFactory`
* [jsscripting] Minor improvements by @J-N-K (#1)
* [jsscripting] Minor changes related to last commit to keep flexibility of `JSRuntimeFeatures`
* [jsscripting] Upgrade openhab-js to v2.1.1
* [jsscripting] Remove unused code

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Co-authored-by: Jan N. Klug <github@klug.nrw>
2022-11-20 22:08:19 +01:00
Florian HotzeandGitHub 103619741d [jsscripting] Fix the console.trace polyfill to log a stack trace & Stringify JS Error (#13749)
* [jsscripting] Fix the `console.trace` polyfill to log a stack trace & Stringify JS `Error`
* [jsscripting] Add myself to the codeowners

Fixes #12646

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-11-20 20:30:42 +01:00
Florian HotzeandGitHub 4dde19203a [jsscripting] Fix maven build (#13747)
This fixed the maven build, that fails because webpack-cli version 5.0.0 doesn’t properly process the given entrypoint.
Instead, webpack tries to use the entrypoint from openhab-js‘ webpack config file.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-11-20 17:30:23 +01:00