-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[jsscriptingnashorn] JavaScript Scripting Nashorn Automation #14013
Conversation
...main/java/org/openhab/automation/jsscriptingnashorn/internal/NashornScriptEngineFactory.java
Outdated
Show resolved
Hide resolved
Would it make sense to integrate the "old" JS transformation or shall we point people to use the |
@wborn Thanks for your PR. I‘ve seen that you listed MIME types as todo, I‘d prefer to discuss that on the issue. For the docs, you could have a look how the GraalJS docs were looking before openhab-js was introduced: https://github.com/openhab/openhab-addons/blob/9912e1afc277f50a8c4f6c1c52634ec7716cc87d/bundles/org.openhab.automation.jsscripting/README.md. @J-N-K I would vote to remove the „old“ JS transformations because for Item transformations you can just switch to the |
Inline-Scripting can be added, looks simple, and I can open a successor for openhab/openhab-core#2872 which would add exactly the missing profile, but I don't see how that would help if no agreement on the design can be reached. |
Great 👍 This is a huge simplification because I then don’t need a file for each and every SCRIPT transformation.
I have had a short look at your PR, I think I need to get my own opinion on this. We need to find a solution for this, otherwise we loose functionality. |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/javascript-scripting-nashorn/134770/2 |
14ec7d5
to
2b2da41
Compare
2b2da41
to
0316aa1
Compare
This add-on allows you to use your older JavaScript (ECMAScript 5.1) rules on newer Java versions until they are migrated to JavaScript (ECMAScript 2021+). The add-on uses a standalone [Nashorn Engine](https://github.com/openjdk/nashorn) which was part of Java until it was removed in Java 15. Signed-off-by: Wouter Born <[email protected]>
For the Nashorn changelog, see: https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md Signed-off-by: Wouter Born <[email protected]>
Signed-off-by: Wouter Born <[email protected]>
Signed-off-by: Wouter Born <[email protected]>
Signed-off-by: Wouter Born <[email protected]>
Signed-off-by: Wouter Born <[email protected]>
Signed-off-by: Wouter Born <[email protected]>
0316aa1
to
2ec19d9
Compare
I've updated the docs and adjusted the script types. I expect the migration of existing scripts to be done in some other PR. 😉 |
The MIME type version extension looks good and the docs as well.
FYI see openhab/openhab-webui#1601, which aims to allow the user to easily change the MIME type of a script. So users can install your Nashorn addon and update the MIME type of their scripts before they have the time to migrate them to GraalJS. |
Sure it will. 🙂 |
It got removed in openhab/openhab-core#2994 Signed-off-by: Wouter Born <[email protected]>
I think it's complete now. There's even an itest that spins up the engine. 🙂 |
Signed-off-by: Wouter Born <[email protected]>
Depends on openhab/openhab-addons#14013 Signed-off-by: Wouter Born <[email protected]>
I'll try to review this soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, thanks!
I've also tested this with the example code from the README, works fine!
I've also had a look at the tests, they all seem reasonable to me 👍
@jlaur From my side, this is ready for merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, many thanks for providing this backwards compatibility.
Depends on openhab/openhab-addons#14013 Signed-off-by: Wouter Born <[email protected]> Signed-off-by: Wouter Born <[email protected]>
commit 1df693a Author: lsiepel <[email protected]> Date: Tue Dec 27 16:27:19 2022 +0100 [bluetooth.am43] null annotations (openhab#13972) * null annotations forbidden package * improve createChecksum * spotless + typo Signed-off-by: lsiepel <[email protected]> commit 8b1d0fc Author: lsiepel <[email protected]> Date: Tue Dec 27 16:16:55 2022 +0100 null annotations - checkstyle (openhab#13979) Signed-off-by: Leo Siepel <[email protected]> commit df6454e Author: lsiepel <[email protected]> Date: Tue Dec 27 16:13:12 2022 +0100 minro checkstyle (openhab#13977) Signed-off-by: Leo Siepel <[email protected]> commit 9687c3d Author: Jiri Kraus <[email protected]> Date: Tue Dec 27 16:08:12 2022 +0100 [velux] Updated Discovery instructions for scenes and actuators (openhab#14009) * Updated Discovery instructions for scenes and actuators Updated Discovery instructions as after KLF200 is auto discovered and configured discovery of scenes and actuators need to be manually triggered. * @jirikraus Updated Discovery instructions for scenes and actuators Formatting update to address comment from @andrewfg. commit 35e930c Author: lsiepel <[email protected]> Date: Tue Dec 27 12:56:43 2022 +0100 [astro] Added moon phase precision (openhab#14067) * add more precision to MoonPhase.Age Signed-off-by: lsiepel <[email protected]> commit 4a98295 Author: mlobstein <[email protected]> Date: Tue Dec 27 05:54:26 2022 -0600 [nuvo] Auto update source channel for grouped zones (openhab#14012) * Auto update source channel for grouped zones Signed-off-by: Michael Lobstein <[email protected]> commit e39e691 Author: Cody Cutrer <[email protected]> Date: Tue Dec 27 03:55:12 2022 -0700 [homekit] support Rollershutter items for HoldPosition (openhab#14045) * [homekit] support Rollershutter items for HoldPosition just send STOP to them * [homekit] log a warning for incompatible HoldPosition items Signed-off-by: Cody Cutrer <[email protected]> commit 0b59be6 Author: Jacob Laursen <[email protected]> Date: Tue Dec 27 11:41:59 2022 +0100 Skip loading/migrating items with invalid name (openhab#14054) Fixes openhab#14053 Signed-off-by: Jacob Laursen <[email protected]> commit e7938ae Author: Holger Friedrich <[email protected]> Date: Tue Dec 27 10:55:15 2022 +0100 [rrd4j] Improve logging of exceptions thrown by getDB (openhab#14068) Add exception message for better identification of root cause. Signed-off-by: Holger Friedrich <[email protected]> commit e5f30b1 Author: Tim Harper <[email protected]> Date: Tue Dec 27 02:25:28 2022 -0700 [tplinksmarthome] Document sending raw commands to devices (openhab#14062) Signed-off-by: Tim Harper <[email protected]> Signed-off-by: Tim Harper <[email protected]> commit 1c5b794 Author: lsiepel <[email protected]> Date: Mon Dec 26 17:00:53 2022 +0100 [airvisualnode] Add null annotations (openhab#13895) * Add null annotation Signed-off-by: Leo Siepel <[email protected]> commit 88c0b72 Author: Wouter Born <[email protected]> Date: Mon Dec 26 15:27:03 2022 +0100 [jsscriptingnashorn] JavaScript Scripting Nashorn Automation (openhab#14013) * [jsscriptingnashorn] JavaScript Scripting Nashorn Automation This add-on allows you to use your older JavaScript (ECMAScript 5.1) rules on newer Java versions until they are migrated to JavaScript (ECMAScript 2021+). The add-on uses a standalone [Nashorn Engine](https://github.com/openjdk/nashorn) which was part of Java until it was removed in Java 15. * Update parent to 3.4.0-SNAPSHOT and nashorn-core to 15.4 For the Nashorn changelog, see: https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md * Update parent to 4.0.0-SNAPSHOT * Remove removeUnsupportedNashornArgs * Update scriptTypes * Add CODEOWNERS entry * Recycle ScriptScopeOSGiTest.java It got removed in openhab/openhab-core#2994 * Remove redundant new line from pom.xml Signed-off-by: Wouter Born <[email protected]> commit 605574b Author: Hilbrand Bouwkamp <[email protected]> Date: Mon Dec 26 10:17:42 2022 +0100 Set openHAB to correct version in binding skeleton scripts. (openhab#14061) Signed-off-by: Hilbrand Bouwkamp <[email protected]> commit 6cd59e4 Author: Jørgen Austvik <[email protected]> Date: Sun Dec 25 20:56:04 2022 +0100 [nanoleaf] More robust caching of layout (openhab#13998) * [nanoleaf] More robust caching of layout This is a bugfix/enhancement to make sure the caching of the layout (to save it from being recalculated) works better: - Only save previous layout if indeed painted - Only save layout from the layout update, not the display state - Recalculate anyway if current state is null * Bugfix: Update colors When Stefan runs, the getBridge() returns null, when Jørgen runs, is doesn't. But it isn't needed, because we are already in the handler, so just call own methods. Improvement: Less draws when updating colors Instead of drawing the picture for each panel (which gave a cool effect), draw only once when we have parsed all color data. Signed-off-by: Jørgen Austvik <[email protected]> commit 0357049 Author: Holger Friedrich <[email protected]> Date: Sat Dec 24 12:11:28 2022 +0100 [knx] Fix SAT warnings (openhab#14052) Signed-off-by: Holger Friedrich <[email protected]> commit f619798 Author: Cody Cutrer <[email protected]> Date: Fri Dec 23 16:00:57 2022 -0700 [lifx] Handle and provide QuantityType for color-temperature-abs channel (openhab#14025) See openhab/openhab-core#3129 Signed-off-by: Cody Cutrer <[email protected]> commit b62e145 Author: Cody Cutrer <[email protected]> Date: Fri Dec 23 15:41:44 2022 -0700 [homekit] Allow configuring secondary services as members of a group (openhab#13879) * [homekit] allow configuring secondary services as members of a group Required introduction of AccessoryGroup to represent the base AccessoryInformationService for ease of configuring multiple of the same service. This is also "breaking" in that someone who previously had HomeKit accessories nested directly inside of a group that was itself a HomeKit accessory will now have those items grouped within the Home app. * [homekit] combine multiple readme sections on complex accessories Signed-off-by: Cody Cutrer <[email protected]> commit b1d4c40 Author: Wouter Born <[email protected]> Date: Fri Dec 23 14:10:58 2022 +0100 Remove JavaScript Transformation pom.xml (openhab#14048) Everything except for this pom.xml got removed in openhab#13276 Signed-off-by: Wouter Born <[email protected]> commit 7c2d5dc Author: Cody Cutrer <[email protected]> Date: Thu Dec 22 16:16:55 2022 -0700 [homekit] implement List-Pairings method (openhab#13982) * [homekit] implement List-Pairings method * [homekit] fix listUsers() method * [homekit] bump HAP-java to 2.0.5 refs openhab#13949 Signed-off-by: Cody Cutrer <[email protected]> commit fbf302e Author: Wouter Born <[email protected]> Date: Fri Dec 23 00:13:17 2022 +0100 Use HTTPS in pom.xml where possible (openhab#14044) Signed-off-by: Wouter Born <[email protected]> commit 14c8b39 Author: Andreas Berger <[email protected]> Date: Thu Dec 22 21:17:07 2022 +0100 [fineoffsetweatherstation] Fix QuantityType for rain-rate (openhab#14039) A community member realized, that the used unit for rain-rate was wrong (https://community.openhab.org/t/fine-offset-weather-station-binding-discussion/134167/153) Rain rate is measured in mm/h and so it is not a `VolumetricFlowRate` but a `Speed`. Additionally, I added some details to the doc. Signed-off-by: Andreas Berger <[email protected]> commit af16d52 Author: Wouter Born <[email protected]> Date: Thu Dec 22 18:21:13 2022 +0100 Fix "Hello, World!" examples in automation documentation (openhab#14041) The documentation states incorrectly that "Hello, World!" is printed when instead "Hello world!" is printed. Signed-off-by: Wouter Born <[email protected]> commit 7195825 Author: lolodomo <[email protected]> Date: Thu Dec 22 18:17:15 2022 +0100 [keba] Fix unit in example for power channel (openhab#14031) Related to openhab#12529 Signed-off-by: Laurent Garnier <[email protected]> commit 16fcd5d Author: lsiepel <[email protected]> Date: Thu Dec 22 09:04:50 2022 +0100 nul;l annotations and codestyle (openhab#13980) Signed-off-by: lsiepel <[email protected]> commit fb31c14 Author: lsiepel <[email protected]> Date: Thu Dec 22 08:58:12 2022 +0100 [bluetooth.govee] null annotations (openhab#13978) * null annotations and checkstyle * Fix more warnings Signed-off-by: lsiepel <[email protected]> commit a079603 Author: Cody Cutrer <[email protected]> Date: Wed Dec 21 16:37:26 2022 -0700 [homekit] allow configuring min/max light level (openhab#14034) since the default is weirdly 0.0001, yet my sensors can report a straight 0. Signed-off-by: Cody Cutrer <[email protected]> commit 462dca8 Author: Cody Cutrer <[email protected]> Date: Wed Dec 21 16:31:05 2022 -0700 [homekit] update AuthInfo objects when blockUserDeletion changes (openhab#14017) * [homekit] update AuthInfo objects when blockUserDeletion changes Signed-off-by: Cody Cutrer <[email protected]> * [homekit] general cleanup of redundant method call and unused local vars Signed-off-by: Cody Cutrer <[email protected]> Signed-off-by: Cody Cutrer <[email protected]> commit 672b60b Author: Cody Cutrer <[email protected]> Date: Wed Dec 21 14:43:46 2022 -0700 [nanoleaf] Handle and provide QuantityType for color-temperature-abs channel (openhab#14026) * [nanoleaf] handle and provide QuantityType for color-temperature-abs channel see openhab/openhab-core#3129 Signed-off-by: Cody Cutrer <[email protected]> commit df8e0bb Author: Cody Cutrer <[email protected]> Date: Wed Dec 21 12:21:53 2022 -0700 [dali] tweak color temperature abs QuantityType fix (openhab#14029) adds an example of usage of the channel to the README, and simplifies one method call Signed-off-by: Cody Cutrer <[email protected]> commit a0c2c76 Author: Christoph Weitkamp <[email protected]> Date: Wed Dec 21 20:10:21 2022 +0100 [hue] Allow handling of QuantityType for color temperature channel (openhab#14024) * Allow handling of QuantityType for color temperature channel * Fixed log messages and reduce log level. Signed-off-by: Christoph Weitkamp <[email protected]> commit 528140d Author: Christoph Weitkamp <[email protected]> Date: Wed Dec 21 17:24:57 2022 +0100 [darksky] Remove DarkSky binding due to EOL of their API (openhab#13037) * Remove DarkSky binding due to EOL of their API Signed-off-by: Christoph Weitkamp <[email protected]> commit 324483d Author: Cody Cutrer <[email protected]> Date: Tue Dec 20 13:15:10 2022 -0700 [dali] handle and provide QuantityType for color-temperature-abs channel (openhab#14021) see openhab/openhab-core#3129 Signed-off-by: Cody Cutrer <[email protected]> commit 4d98cca Author: Florian Hotze <[email protected]> Date: Tue Dec 20 09:15:43 2022 +0100 [jsscripting] Minor fixes & improvements (openhab#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 <[email protected]> commit cd9e1b0 Author: J-N-K <[email protected]> Date: Tue Dec 20 08:11:31 2022 +0100 Fix build / Resolve itests (openhab#14018) * Fix build / Resolve itests * Remove Java 11 from GHA matrix Also-by: Wouter Born <[email protected]> Signed-off-by: Jan N. Klug <[email protected]> commit 0b1eb2c Author: lsiepel <[email protected]> Date: Tue Dec 20 00:06:52 2022 +0100 null annotations (openhab#13976) Signed-off-by: Leo Siepel <[email protected]> commit 1519cb4 Author: lsiepel <[email protected]> Date: Tue Dec 20 00:04:43 2022 +0100 nul annotations, checkstyle, forbidden packagel (openhab#13981) Signed-off-by: lsiepel <[email protected]> commit 40b8b77 Author: lsiepel <[email protected]> Date: Tue Dec 20 00:01:50 2022 +0100 Very minor checkstyle (openhab#13973) Signed-off-by: Leo Siepel <[email protected]> commit 127f998 Author: Jacob Laursen <[email protected]> Date: Mon Dec 19 23:49:51 2022 +0100 Upgrade MySQL Connector/J to 8.0.31 (openhab#13991) Signed-off-by: Jacob Laursen <[email protected]> commit 3bec273 Author: Holger Friedrich <[email protected]> Date: Mon Dec 19 22:58:43 2022 +0100 [rrd4j] Upgrade base library from 3.8.1 to 3.8.2 (openhab#13956) Signed-off-by: Holger Friedrich <[email protected]> commit 3aefefb Author: Holger Friedrich <[email protected]> Date: Mon Dec 19 22:49:40 2022 +0100 [knx] Upgrade Calimero library to release 2.5.1 (openhab#14015) Signed-off-by: Holger Friedrich <[email protected]> commit 9f3b8e1 Author: J-N-K <[email protected]> Date: Mon Dec 19 20:39:42 2022 +0100 Raise minimum JDK version to 17 (openhab#13276) Signed-off-by: Jan N. Klug <[email protected]> commit 4d6d644 Author: J-N-K <[email protected]> Date: Mon Dec 19 15:22:17 2022 +0100 fix spotless after release (openhab#14014) Signed-off-by: Jan N. Klug <[email protected]> commit 7993786 Author: openhab-bot <[email protected]> Date: Mon Dec 19 00:55:11 2022 +0000 [unleash-maven-plugin] Preparation for next development cycle. commit c5b68d0 Author: Jacob Laursen <[email protected]> Date: Sun Dec 18 23:22:40 2022 +0100 Fix NullPointerException (openhab#14010) Fixes openhab#13961 Signed-off-by: Jacob Laursen <[email protected]> commit 4871d6d Author: Wouter Born <[email protected]> Date: Sun Dec 18 19:50:23 2022 +0100 [shelly] Remove broken images (openhab#14007) See also openhab#13993 Signed-off-by: Wouter Born <[email protected]> commit 8d65371 Author: Wouter Born <[email protected]> Date: Sun Dec 18 19:49:42 2022 +0100 [shelly] Remove broken images (openhab#14007) See also openhab#13993 Signed-off-by: Wouter Born <[email protected]> commit 3613799 Author: Kai Takac <[email protected]> Date: Sun Dec 18 19:04:43 2022 +0100 [jdbc] Update org.xerial/sqlite-jdbc to 3.40.0.0 (openhab#14003) * [jdbc] Update org.xerial/sqlite-jdbc to 3.40.0.0 Co-authored-by: Jacob Laursen <[email protected]> Signed-off-by: Kai Takac <[email protected]> commit ef836a1 Author: Дилян Палаузов <[email protected]> Date: Sun Dec 18 15:18:24 2022 +0200 typos: success, successful (openhab#13997) commit 6b1354f Author: openhab-bot <[email protected]> Date: Sun Dec 18 14:02:15 2022 +0100 New Crowdin updates (openhab#13999) * New translations iCloud.properties (French) * New translations openwebnet.properties (Italian) * New translations plugwise.properties (Dutch) commit 6dd8cd5 Author: MikeTheTux <[email protected]> Date: Sun Dec 18 13:35:08 2022 +0100 fixed potential StringIndexOutOfBoundsExceptions (openhab#14000) fixed compiler warnings Signed-off-by: Michael Weger <[email protected]> commit debdfa5 Author: Holger Friedrich <[email protected]> Date: Sun Dec 18 11:55:59 2022 +0100 [wolfsmartset] Fix link to external documentation (openhab#13996) Update link to current document from Wolf download center. Fixes openhab#13995. Signed-off-by: Holger Friedrich <[email protected]> commit 9b89130 Author: Jacob Laursen <[email protected]> Date: Sun Dec 18 10:22:07 2022 +0100 Fix alignment/indentation (openhab#13994) Fixes openhab#13882 Signed-off-by: Jacob Laursen <[email protected]> commit d03d3e4 Author: Wouter Born <[email protected]> Date: Sat Dec 17 23:53:57 2022 +0100 Show add-on intros in Main UI (openhab#13992) Using these Markdown tweaks a small intro will show in Main UI instead of emptyness and a "more" button. Signed-off-by: Wouter Born <[email protected]> commit 6753234 Author: Jacob Laursen <[email protected]> Date: Sat Dec 17 17:25:38 2022 +0100 Fix Zigbee name stylization (openhab#13954) Signed-off-by: Jacob Laursen <[email protected]> commit d20b103 Author: openhab-bot <[email protected]> Date: Sat Dec 17 16:51:35 2022 +0100 New Crowdin updates (openhab#13990) * New translations tr064.properties (German) * New translations jsscripting.properties (Danish) * New translations jsscripting.properties (Italian) commit 15e6beb Author: Florian Hotze <[email protected]> Date: Sat Dec 17 15:42:23 2022 +0100 [yamaha] README: Recommend correct binding for specific model (openhab#13985) This doc improvement tries to avoid future issue like openhab#10838. Signed-off-by: Florian Hotze <[email protected]> commit 11e2c4f Author: Florian Hotze <[email protected]> Date: Sat Dec 17 13:40:12 2022 +0100 [jsscripting] Update add-on name in default translation (openhab#13984) Leftover from openhab#13764. Signed-off-by: Florian Hotze <[email protected]> commit 4a13e1a Author: openhab-bot <[email protected]> Date: Sat Dec 17 12:13:24 2022 +0100 New Crowdin updates (openhab#13971) * New translations knx.properties (German) * New translations yamahamusiccast.properties (German) * New translations hdpowerview.properties (Danish) * New translations jsscripting.properties (Danish) commit 23875a6 Author: Wouter Born <[email protected]> Date: Fri Dec 16 11:22:48 2022 +0100 [mapdb] Fix "a" typo and use "-" for bullets in docs (openhab#13966) Signed-off-by: Wouter Born <[email protected]> commit ab504bc Author: Dan Cunningham <[email protected]> Date: Thu Dec 15 23:31:02 2022 -0800 [hydrawise] fixes null pointer error for some sprinkler controllers (openhab#13965) Signed-off-by: Dan Cunningham <[email protected]> commit 15ad22b Author: Wouter Born <[email protected]> Date: Thu Dec 15 23:39:37 2022 +0100 [mapdb] Add some documentation (openhab#13964) This is based on the original OH1 documentation. Signed-off-by: Wouter Born <[email protected]> commit d6db727 Author: openhab-bot <[email protected]> Date: Thu Dec 15 23:36:49 2022 +0100 New Crowdin updates (openhab#13962) * New translations chromecast.properties (Italian) * New translations sonos.properties (Italian) * New translations exec.properties (Italian) * New translations knx.properties (German) * New translations jsscripting.properties (German) * New translations yamahamusiccast.properties (German) commit c75b04e Author: Wouter Born <[email protected]> Date: Thu Dec 15 22:40:52 2022 +0100 [wundergroundupdatereceiver] Prevent 😕 showing in documentation (openhab#13963) See: https://www.openhab.org/addons/bindings/wundergroundupdatereceiver/ Signed-off-by: Wouter Born <[email protected]> commit 9318f6f Author: Holger Friedrich <[email protected]> Date: Thu Dec 15 16:22:43 2022 +0100 [knx] Minor documentation update (openhab#13918) Slightly change wording of docs related to localSourceAddress to avoid address conflicts during initial setup. Add remark about knxd. Fixes openhab#13602. Signed-off-by: Holger Friedrich <[email protected]> commit 83f0f7a Author: Wouter Born <[email protected]> Date: Thu Dec 15 12:28:32 2022 +0100 Prevent Markdown rendering issues in Main UI (openhab#13958) Some add-ons use `---` separators which causes issues when rendering the documentation in Main UI. Fixes openhab#13953 Signed-off-by: Wouter Born <[email protected]> commit 6ab0561 Author: Holger Friedrich <[email protected]> Date: Thu Dec 15 11:31:20 2022 +0100 [rrd4j] Error handling for broken rrd4j files (openhab#13955) * [rrd4j] Error handling for broken rrd4j files Catch exceptions thrown by getDB(..) and print the name of the affected database file. This allows to identify a broken rrd4j file. Signed-off-by: Holger Friedrich <[email protected]> commit 04f059c Author: Simon Spielmann <[email protected]> Date: Thu Dec 15 09:18:11 2022 +0100 [icloud] Rework authentication to reflect changes in iCloud API (openhab#13691) * Implement Authentication (WIP) * Validation Code accepted * Refactor session state * RefreshClient working * Implement session persistence in openhab store * Integration in binding * Remove persistent cookies, which break authentication * Bugfixing * Add code configuration to UI * Improve documentation, error-handling and cleanup * Rework auth order * Rework auth process * Add 2-FA-auth to documentation * Set bridge to online if data refresh works * Case-sensitive rename ICloudAPIResponseException * Include authentication in refresh flow * Fix regression for data not being updated * Fix typo in i18n props * Fix review and checkstyle. * More javadoc, new RetryException * Introduce @NonNullByDefault * Introduce server for RetryException, add NonNullbyDefault, fix warnings * Rework for contribution, e.g. null checks, ... * Fix checkstyle * Move JsonUtils to utilities package * Async initialize bridge handler. * Report Device OFFLINE if Bridge is OFFLINE * Set bridge thing status to UNKOWN in init * Move refresh init into async init * Cancel init task in dispose Also-by: Leo Siepel <[email protected]> Signed-off-by: Simon Spielmann <[email protected]> commit 6e8b35c Author: Wouter Born <[email protected]> Date: Thu Dec 15 07:51:22 2022 +0100 [jsscripting] Fix broken event object table (openhab#13952) The table is not properly rendered when reading the documentation in Main UI. Signed-off-by: Wouter Born <[email protected]> commit 79060f3 Author: Jørgen Austvik <[email protected]> Date: Wed Dec 14 20:15:47 2022 +0100 [nanoleaf] Bugfix: Handle non-integer panel ids (openhab#13951) Panel ids are sometimes returned as BigInteger We haven't been able to understand why this happens somewhere and somewhere not, but this is an sledgehammer attempt to fix it quickly to unblock users, and then we will try to understand it later. Discussions: https://community.openhab.org/t/java-lang-classcastexception-class-java-math-bigdecimal-cannot-be-cast-to-class-java-lang-integer/142035/16 https://community.openhab.org/t/nanoleaf-binding-oh3-stabilization-update/116300/61 Signed-off-by: Jørgen Austvik <[email protected]> commit d4ec220 Author: Florian Hotze <[email protected]> Date: Wed Dec 14 20:12:54 2022 +0100 [jsscripting] Extend synchronization to common ScriptEngine methods (openhab#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 openhab/openhab-core#3180. * Revert "[jsscripting] Extend synchronization to common ScriptEngine methods" This reverts commit aadd21e. * [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 openhab/openhab-core#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 <[email protected]> commit 1ca9baf Author: Jerome Luckenbach <[email protected]> Date: Wed Dec 14 16:52:43 2022 +0100 [Documentation] Markdown improvements n to s (openhab#13948) Signed-off-by: Jerome Luckenbach <[email protected]> commit d73218d Author: Udo Hartmann <[email protected]> Date: Wed Dec 14 08:21:34 2022 +0100 [mqtt.generic] Change color example (openhab#13861) Change color example to fit to the real parameters. commit 4aca2c6 Author: Cody Cutrer <[email protected]> Date: Tue Dec 13 15:28:55 2022 -0700 [jrubyscripting] remove some development logging that crept in (openhab#13947) Signed-off-by: Cody Cutrer <[email protected]> commit 8314433 Author: lolodomo <[email protected]> Date: Tue Dec 13 09:04:16 2022 +0100 [mielecloud] Fix integration tests (openhab#13935) Code change provided by @BjoernLange Signed-off-by: Laurent Garnier <[email protected]> commit e9473ca Author: Hilbrand Bouwkamp <[email protected]> Date: Tue Dec 13 08:40:10 2022 +0100 [airq] fix table in readme that broke rendering markup (openhab#13937) Signed-off-by: Hilbrand Bouwkamp <[email protected]> commit 9c3ec38 Author: openhab-bot <[email protected]> Date: Tue Dec 13 07:27:26 2022 +0100 New Crowdin updates (openhab#13932) * New translations boschshc.properties (Italian) * New translations ecowatt.properties (French) * New translations nikohomecontrol.properties (Dutch) * New translations systeminfo.properties (Dutch) * New translations upnpcontrol.properties (Dutch) commit bd087f1 Author: Jacob Laursen <[email protected]> Date: Mon Dec 12 22:55:38 2022 +0100 Fix examples after migration of time channels (openhab#13933) Signed-off-by: Jacob Laursen <[email protected]> commit 286a27d Author: Wouter Born <[email protected]> Date: Mon Dec 12 22:12:24 2022 +0100 [nest] Add missing enable SDM API configuration step to README.md (openhab#13931) Fixes openhab#11814 Signed-off-by: Wouter Born <[email protected]> commit 518272a Author: Jacob Laursen <[email protected]> Date: Mon Dec 12 22:10:48 2022 +0100 Fix dimension for powerConsumption channel (openhab#13930) Fixes openhab#13929 Signed-off-by: Jacob Laursen <[email protected]> commit e027932 Author: lolodomo <[email protected]> Date: Mon Dec 12 20:28:59 2022 +0100 [goecharger] Consider correct channel ID (maxCurrentTemp) (openhab#13927) Fix openhab#13891 Signed-off-by: Laurent Garnier <[email protected]>
Reference openhab/openhab-addons#14013. Reference openhab/openhab-addons#14096. Signed-off-by: Florian Hotze <[email protected]>
Reference openhab/openhab-addons#14013. Reference openhab/openhab-addons#14096. Signed-off-by: Florian Hotze <[email protected]>
Reference openhab/openhab-addons#14013. Reference openhab/openhab-addons#14096. Signed-off-by: Florian Hotze <[email protected]> Signed-off-by: Florian Hotze <[email protected]>
…#14013) * [jsscriptingnashorn] JavaScript Scripting Nashorn Automation This add-on allows you to use your older JavaScript (ECMAScript 5.1) rules on newer Java versions until they are migrated to JavaScript (ECMAScript 2021+). The add-on uses a standalone [Nashorn Engine](https://github.com/openjdk/nashorn) which was part of Java until it was removed in Java 15. * Update parent to 3.4.0-SNAPSHOT and nashorn-core to 15.4 For the Nashorn changelog, see: https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md * Update parent to 4.0.0-SNAPSHOT * Remove removeUnsupportedNashornArgs * Update scriptTypes * Add CODEOWNERS entry * Recycle ScriptScopeOSGiTest.java It got removed in openhab/openhab-core#2994 * Remove redundant new line from pom.xml Signed-off-by: Wouter Born <[email protected]>
Reference openhab/openhab-addons#14013. Reference openhab/openhab-addons#14096. Signed-off-by: Florian Hotze <[email protected]> Signed-off-by: Florian Hotze <[email protected]> Signed-off-by: Boris Krivonog <[email protected]>
…#14013) * [jsscriptingnashorn] JavaScript Scripting Nashorn Automation This add-on allows you to use your older JavaScript (ECMAScript 5.1) rules on newer Java versions until they are migrated to JavaScript (ECMAScript 2021+). The add-on uses a standalone [Nashorn Engine](https://github.com/openjdk/nashorn) which was part of Java until it was removed in Java 15. * Update parent to 3.4.0-SNAPSHOT and nashorn-core to 15.4 For the Nashorn changelog, see: https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md * Update parent to 4.0.0-SNAPSHOT * Remove removeUnsupportedNashornArgs * Update scriptTypes * Add CODEOWNERS entry * Recycle ScriptScopeOSGiTest.java It got removed in openhab/openhab-core#2994 * Remove redundant new line from pom.xml Signed-off-by: Wouter Born <[email protected]>
…#14013) * [jsscriptingnashorn] JavaScript Scripting Nashorn Automation This add-on allows you to use your older JavaScript (ECMAScript 5.1) rules on newer Java versions until they are migrated to JavaScript (ECMAScript 2021+). The add-on uses a standalone [Nashorn Engine](https://github.com/openjdk/nashorn) which was part of Java until it was removed in Java 15. * Update parent to 3.4.0-SNAPSHOT and nashorn-core to 15.4 For the Nashorn changelog, see: https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md * Update parent to 4.0.0-SNAPSHOT * Remove removeUnsupportedNashornArgs * Update scriptTypes * Add CODEOWNERS entry * Recycle ScriptScopeOSGiTest.java It got removed in openhab/openhab-core#2994 * Remove redundant new line from pom.xml Signed-off-by: Wouter Born <[email protected]>
This add-on allows you to use your older ECMAScript 5.1 code on newer Java versions until the code is migrated to ECMAScript 2021+. It should only be installed for providing backwards compatibility. When writing new code it is preferred to do this using ECMAScript 2021+ for which support is provided by installing the JavaScript Scripting add-on.
This add-on uses a standalone Nashorn Engine to run ECMAScript 5.1 code. The Nashorn Engine was pre-installed in openHAB 2 and openHAB 3 because it was part of Java. Since Java 15 the Nashorn Engine has been removed from Java.
This PR is based on the JavaScript Scripting (Nashorn) Marketplace add-on.
To do: