Commit Graph

1333 Commits (5282f447fda99cb954bbc2e016ab5f7bf3edd030)

Author SHA1 Message Date
stefan-hoehn 5282f447fd
[blockly] Add more thing blocks (#2562)
Fixes #2552.

Add missing blocks to work with a thing or a group of things:

- oh_getthing (one particular)
- oh_getthing_state (the state of the string - to be consistent with
items)
- oh_getthings (get all things - can be used to iterate over all things)
- oh_getthing_attribute (retrieve any attribute of a thing)

---------

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2024-05-07 17:58:18 +02:00
Florian Hotze 8ed66cc642
[blockly] Adjust persistence blocks to breaking changes (#2564)
This adjusts the persistence blocks for the **breaking** changes of
`org.openhab.core.persistence.extensions.PersistenceExtensions`.

For NashornJS, see https://github.com/openhab/openhab-core/pull/3736 for the changes.
For GraalJS, see
https://next.openhab.org/addons/automation/jsscripting/#itempersistence for the current API docs and
https://github.com/openhab/openhab-js/pull/331 for the changes.

---------

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-05-07 17:55:25 +02:00
Mark Herwege 6bb52b5aca
Item parser: Add missing group item aggregation functions (#2567)
See https://community.openhab.org/t/groupnor-not-working-anymore/155812.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-05-07 17:45:00 +02:00
dependabot[bot] 8779dcf694
Bump ejs from 3.1.9 to 3.1.10 in /bundles/org.openhab.ui/web (#2560)
Bumps [ejs](https://github.com/mde/ejs) from 3.1.9 to 3.1.10.

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-07 13:03:23 +02:00
Mark Herwege 5f3d6daa21
Setup wizard: Add primary IP config (#2565)
Add-on finders scan the network for devices supported by OH add-ons to suggest suitable add-ons.
These are presented in the setup-wizard (and add-ons store).

To limit network traffic, especially for IP broadcast and multicast scans,
finders could limit the traffic to one subnet.
This is especially relevant if the setup would be on servers with many
network interfaces or when using Docker. 

This commit adds setting up a primary IP address to the setup,
which will also default the broadcast address accordingly to the primary address.
Querying add-on suggestions is delayed until after this step, 
and some delay is built into the process to allow suggestions finders to scan the network.

See discussion in https://github.com/openhab/openhab-core/pull/4036.

---------

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-05-07 12:54:30 +02:00
Mark Herwege 3fa319248b
Sitemap editor: Add press release button support (#2553)
Related to https://github.com/openhab/openhab-core/pull/4183.
Depends on https://github.com/openhab/openhab-core/pull/4204.

This PR implements press/release button support.

Refactor code to allow proper quoting of arguments in mappings and conditions.
Quotes are now preserved, and therefore they need to be removed in core
at usage (https://github.com/openhab/openhab-core/pull/4204).

---------

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-05-07 10:44:40 +02:00
lolodomo 02024c62b5
[BasicUI] Implement press & release button (#2536)
Related to openhab/openhab-core#3822

Depends on openhab/openhab-core#4183

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-05-06 20:55:24 +02:00
Florian Hotze 50f2a91703
Update openhab-js tern defs (#2563)
This updates the tern defs used for autocompletion to the current library version included in the addon (5.0.0)
and also cleans up the actions namespace (remove functionality that is included in superior APIs like `things`).
Reference https://github.com/openhab/openhab-js/compare/v4.7.0...v5.0.0.

Last update was in #2220.

---------

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-05-06 12:02:59 +02:00
Florian Hotze 9d89146705
Setup wizard: Fix already set i18n settings not respected (#2559)
Fixes https://github.com/openhab/openhab-core/issues/4105.

The setup wizard did not respect the i18n config file's content, which
resulted in overwriting the existing i18n settings.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-05-02 14:42:06 +02:00
Florian Hotze 6f5a59f57e
Setup wizard: Fix server-set region and location not shown on later wizard launch (#2558)
This makes the setup wizard load the region and the location from the
server.
Useful when the wizard is re-launched later.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-05-02 12:57:32 +02:00
lolodomo 93f758b75b
[BasicUI] Fix build after a method renaming in core framework (#2557)
Related to openhab/openhab-core#3652 that renamed method setPageId into
updateSubscriptionLocation

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-05-02 11:01:55 +02:00
Florian Hotze 14a6c9e59d
Setup wizard: Refactor add-on selection & Add descriptions for JS Scripting & Astro (#2556)
- Move the selection of additional add-ons into the addons-setup-wizard.vue component.
- Add description texts for suggested add-ons JS Scripting and Astro.

---------

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-05-01 15:02:43 +02:00
Mark Herwege faa4018536
Setup wizard: Add separate step for persistence (#2431)
This improves the first installation experience by:

- Splitting out persistence to a separate step of the setup wizard (and no persistence will be offered in the main wizard addon selection anymore).
- Allows unselecting addons from the shown list without having to open the selection popup again.
- Including Mapdb as a proposal for a persistence service to install
- Including Astro binding in the recommended addons at initial install

This also creates the groundwork to implement more fine grained suggestions in the setup wizard 
by allowing to have separate steps for types of addons or specific addons.
It is possible to set extra text for identified add-ons.

---------

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-05-01 12:37:58 +02:00
Florian Hotze c6e1d8bc87
Use Node v20 for Main UI build (#2434)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-04-30 16:55:03 +02:00
Florian Hotze 13169c1475
Add-on logo component: Make lazy loading optional (#2555)
This makes the lazy loading of the add-on logo optional (can be enabled
using a config property) in preparation to use the add-on logo component
inside the setup-wizard.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-04-30 15:52:29 +02:00
Mark Herwege d292cf6ae8
Sitemap editor: Fix buttongrid editor (#2554)
Fields should use all space available. In a button grid definition the
row and column fields where not visible.

I can't say what caused this, but this PR should fix this.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-04-30 13:59:01 +02:00
lolodomo b27d71392e
[BasicUI] Add special handling for "none" icon (#2534)
Same behaviour as in the Android app is now implemented for the "none"
icon. This icon means "no icon" and we don't want to request the icon
servlet. When this icon is associated to a sitemap element, the icon
servlet is no more requested. Instead, a simple empty SVG tag is
considered and inserted in the HTML page. There is also no dynamic
behaviour (with item state) applied for this icon.

Additionally, in case the loading of any OH icon fails, the IMG tag is
replaced by an empty SVG tag in the HTML page instead of updating the
IMG source with the none icon URL (triggering a potential new icon
servlet request).

Fix openhab/openhab-core#3977

Signed-off-by: Laurent Garnier <lg.hc@free.fr>

---------

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-04-27 10:48:05 +02:00
Holger Friedrich 10aeb247ae
Update Maven plugins (#2551)
Update nearly all Maven plugins:

* set minimum Maven version to 3.6.3
* build-helper-maven-plugin, 3.4.0 to 3.5.0, see
https://github.com/mojohaus/build-helper-maven-plugin/releases/tag/3.5.0
* frontend-maven-plugin, 1.13.4 to 1.15.0, see
https://github.com/eirslett/frontend-maven-plugin/blob/master/CHANGELOG.md
* license-maven-plugin, 4.2 to 4.3
* maven-clean-plugin, 3.3.1 to 3.3.2, see
https://github.com/apache/maven-clean-plugin/releases
* maven-dependency-plugin, 3.6.0 to 3.6.1, see
https://github.com/apache/maven-dependency-plugin/releases/tag/maven-dependency-plugin-3.6.1
* maven-enforcer-plugin, 3.4.0 to 3.4.1
* maven-jar-plugin, 3.3.0 to 3.4.1, see
https://github.com/apache/maven-jar-plugin/releases
* maven-javadoc-plugin, 3.2.0 to 3.6.3, see
https://github.com/apache/maven-javadoc-plugin/releases
* maven-plugin-plugin, 3.9.0 to 3.12.0, see
https://github.com/apache/maven-plugin-tools/releases/tag/maven-plugin-tools-3.12.0
* maven-site-plugin, 3.12.1 to 4.0.0-M13
* maven-source-plugin, 3.3.0 to 3.3.1
* maven-surefire-plugin, 3.1.2 to 3.2.5, see
https://github.com/apache/maven-surefire/releases
* sortpom-maven-plugin, 3.3.0 to 3.4.1
* spotless-maven-plugin, 2.38.0 to 2.43.0, see
https://github.com/diffplug/spotless/blob/main/plugin-maven/CHANGES.md

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-04-26 10:57:54 +02:00
Florian Hotze 3396a4f639
Charts: Fix initial period wrongly calculated for future charts (#2548)
Follow-up fix for #2545.

When the initial period was different from `D`, the period initial
endTime calculation was wrong.
This lead to the initial period being calculated wrong: One day was
always into the future, the rest of the period to the past.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-04-23 14:01:45 +02:00
Florian Hotze e9c5ad505f
Charts: Add option to extend initial period to future & Refactor prop defs (#2545)
This adds a new option to charts which allows to extend the initial period to the future by default.
Until now, when a chart was opened its period always extended to the past.
This is especially useful with the new timeseries support for Items as it allows to display forecasts.

Also refactor the chart property definitions to use the helpers.

---------

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-04-21 17:13:39 +02:00
lolodomo 0c7aa4d07d
[BasicUI] Fix slider behaviour and implement two different modes (#2535)
Fix #2525
Also related to openhab/openhab-core#4084 and openhab/openhab-core#3430

Two behaviour modes are now supported.
- If releaseOnly parameter is set, the new value is sent to the item
only when the slider is released.
- If releaseOnly parameter is not set, new values are sent to the item
while moving the slider. Events are sent at a certain frequency, this
frequency is defined by the sendFrequency parameter if set or every 200
ms by default. Event is not sent when the value is is unchanged (when
stopping the move but keeping the mouse pressed).

The brightness slider of the colorpicker widget is also updated to send
regular new color commands when moving the slider.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-04-21 16:29:19 +02:00
Mark Herwege 736d12c703
Save stateDescriptionPattern from channel type for UoM Items & Save UoM metadata when adding from model (#2485)
When creating a new Number with Dimension item from a channel link, the
stateDescriptionPattern does not propose the state description pattern
from the channel type as the default.

This commit introduces this:

It only saves this state description pattern from the channel type to
metadata of the item if it is not the default state description pattern
for a Number type.

Subsequent edits of the item will present a disabled state description pattern input.
If no state description field is set, a blank field will be presented.
Reasons are:
- A state description can contain more than a pattern.
  Saving only the pattern would override the rest of the stateDescription.
- An Item can be linked to multiple channels with (possibly conflicting) stateDescription.
  The only solution would be for the user the set it on the item and override the channel stateDescriptions.

See https://github.com/openhab/openhab-addons/pull/16531#discussion_r1530394678.

This PR also now saves the unit (and state description pattern) when creating equipment or point from a thing.

---------

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-04-21 15:00:18 +02:00
Florian Hotze e5d930b057
Metadata: Add `link_to_more` as well-known namespace (#2543)
Closes #2382.
Refs https://github.com/openhab/openhab-android/issues/3140.

Adds Android app's link_to_more metadata to the well-known namespaces,
therefore also adds an editing page for it.

---------

Also-by: mueller-ma <mueller-ma@users.noreply.github.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-04-21 14:56:42 +02:00
lolodomo 9e48ad8693
[BasicUI] Fix update of buttons (switch element) (#2538)
Fix #2537

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-04-21 11:40:15 +02:00
Florian Hotze 2de1521cf9
Script edit: Fix script creation fails due to exception (#2542)
Regression from #2508.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-04-20 23:40:10 +02:00
Florian Hotze 83147c23ac
Persistence edit: Add support for selecting all Items (#2541)
Closes #2516.

Adds a new toggle to the configuration popup of persistence edit to
select all Items (the equivalent to the `*` wildcard in file-based config).
If all Items are selected, the group Item and normal Item pickers will be disabled.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-04-20 23:29:39 +02:00
Florian Hotze aadeb38d3d
SSE Item State Tracking: Avoid requesting __ob__ and __v_isRef (#2540)
Fixes #2530.
Regression from #2489.

I wasn't able to identify the root cause, but this seems to solve the problem.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-04-20 22:52:11 +02:00
dependabot[bot] b614f97156
Bump tar from 6.1.13 to 6.2.1 in /bundles/org.openhab.ui.basic (#2531)
Bumps [tar](https://github.com/isaacs/node-tar) from 6.1.13 to 6.2.1.

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-20 21:21:07 +02:00
Florian Hotze bb66514642
Things list: Always show the inbox (#2539)
This allows to access the inbox if it only contains ignored entries
without having to manually enter the page route.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-04-20 21:15:56 +02:00
Mark Herwege 1232bf5606
Allow future periods in sitemap configuration (#2529)
Chart widget sitemap configuration has been extended with support for
future periods in https://github.com/openhab/openhab-core/pull/4172.
This adds configuration in the UI.

See #2518.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-04-12 12:45:29 +00:00
openhab-bot c546534602
New Crowdin updates (#2527) 2024-04-12 12:38:03 +00:00
openhab-bot ac6b3a4eef
New Crowdin updates (#2528) 2024-04-12 12:37:18 +00:00
Holger Friedrich 345e93e363
Bump maven-compiler-plugin to 3.13.0 (#2520)
Avoid ZipException with ejc >3.30.0.

Refs: openhab/openhab-core#4167

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-04-12 12:36:37 +00:00
Florian Hotze 4a0054a1f0
Thing details: Fix code tab not editable (#2526)
Fixes #2523.

Regression from one of the previous PRs to the Thing details page.

This is a timing issue similar to #2375, where the code editor is
initialized as read-only because the Thing is not loaded yet.
After initialisation, the editor can not be set to read-write.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-04-07 11:51:24 +02:00
lolodomo aaf3edcd09
[BasicUI] Adjust user-defined colors to theme for better contrast (#2521)
Closes #1780

Colors are those defined by user through the labelcolor, valuecolor and
iconcolor parameters. The aim is to provide a good contrast n both
themes. For example white in light theme just leads to something not
visible. So black is used instead.

This behaviour is already implemented in the Android app with the same
adjustments.

Colors adjusted in light theme: yellow, pink, white, lime, aqua, silver
and gold.
Colors adjusted in dark theme: maroon, purple, green, navy, blue, black
and gold.

These color adjustments are controlled by a new Basic UI setting,
enabled by default. By disabling it, no adjustment is performed and the
old behaviour is restored.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-04-07 11:17:45 +02:00
lolodomo 1db2d0bea4
[BasicUI] Add predefined periods in future for chart (#2524)
Related to #2518

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-04-07 10:54:10 +02:00
lolodomo 93e6e97bc4
[BasicUI] All buttons forced on one line for a Player item (#2492)
Follow-up #2341
Partial revert to make two exceptions and restore old behaviour (buttons
on a unique line) for:
* Control buttons of a Player item
* Buttons in the settings page

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-04-07 10:43:27 +02:00
Holger Friedrich 730ab97d7b
Allow for compiling with Java 21 (#2517)
* Support Java 17 and 21, default compilation to Java 17 class files
* Add profile "j21" to compile to Java 21 class files
* Bump ecj to 3.36.0
* Upgrade SAT to 0.16.0

Refs:
https://github.com/openhab/openhab-distro/issues/1590

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-04-03 11:04:31 +02:00
Florian Hotze 0449e5111b
Things list: Fix broken list index after Thing removal (#2515)
After a Thing has been removed, the list index showed several wrong
entries derived from Thing labels.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-30 22:09:07 +01:00
Florian Hotze c9f2a4effd
Downgrade vue-fragment as the upgrade broke oh-repeater in some circumstances (#2514)
When we upgrade to Vue 3, we can remove this dependency as Vue 3 has
this functionality integrated, see
https://api.vueframework.com/guide/migration/fragments.html.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-30 22:00:58 +01:00
Florian Hotze 57025c3832
Chart calendar axis: Don't override user-defined dayLabel and monthName settins (#2513)
This e.g. allows to set dayLabel.nameMap
(https://echarts.apache.org/en/option.html#calendar.dayLabel.nameMap).

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-30 19:58:02 +01:00
Florian Hotze 673ef9b1ca
Things (inbox) list: Improve condition for reversed checkbox style (#2512)
Follow-up for #2472.

Improve the condition to only show the reversed order where really
required.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-30 12:58:02 +01:00
Florian Hotze 2539d6dcf3
Analyzer: Fix analyzer not initially visible on iOS 17.4 (#2511)
When the analyzer was opened on iOS/iPadOS 17.4 devices, the screen stayed blank until the controls were opened.

ECharts logged the following warning to the console:

[ECharts] Can't get DOM width or height.Please check dom.clientWidth and dom.clientHeight.
They should not be 0.For example, you may need to call this in the callback of window.onload.

Reported on the community:
https://community.openhab.org/t/openhab-4-1-release-discussion/152252/188?u=florian-h05.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-29 17:24:03 +01:00
Florian Hotze 4d5a4a4a81
Downgrade pkce-challenge to fix authentication for insecure (HTTP) contexts (#2510)
Regression from #2488.

Version 4.x of pkce-challenge uses the Web Crypto API, which is only
available in secure contexts (https) in most browsers.
This broke the login when accessing the UI over an insecure (plain HTTP)
connection.
See https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-29 14:52:40 +01:00
openhab-bot 01203e1c61
New Crowdin updates (#2494) 2024-03-29 11:11:32 +01:00
dependabot[bot] 85d3e477fd
Bump express from 4.18.2 to 4.19.2 in /bundles/org.openhab.ui/web (#2507)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-29 11:10:52 +01:00
Florian Hotze 5507555908
Charts config: Add gauge and pie chart types (#2509)
Those are imported in
974e28e9ba/bundles/org.openhab.ui/web/src/components/widgets/system/oh-chart-component.vue (L47)
and should therefore work.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-27 10:01:12 +01:00
Florian Hotze 974e28e9ba
Script edit: Fix dirty handling (#2508)
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-26 12:12:23 +01:00
Florian Hotze ea59ce14e2
Upgrade Framework7 to latest v5 version (#2506)
Framework7 v6 requires Vue 3, so we need to upgrade to Vue 3 as well
when upgrading to Framework7 v6.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-26 02:20:45 +01:00
Florian Hotze 72f53e6ff8
Rule edit: Fix rule module title and description regression (#2505)
Fixes regression from #2471.
See https://github.com/openhab/openhab-webui/pull/2471#discussion_r1538237708.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2024-03-26 02:08:33 +01:00