Commit Graph

1119 Commits (1c03c60f84388b9d7da0231df2d4ebb1e17d3fcf)

Author SHA1 Message Date
Florian Hotze 376f036d04
Add a persistence configuration page (#1917)
Closes #1463.
Refs https://github.com/openhab/openhab-core/pull/2871.
Refs https://github.com/openhab/openhab-core/pull/3642.

It is accessible from the add-on settings page and has both a design and
a code tab.

The design tab allows to set persistence strategies for Items, define
cron strategies and set the default strategies. It does not duplicate
names for (cron) persistence strategies and filters as well as configs
for the same set of Items.
All four filters provided by openHAB core (treshold, time, equals/not
equals, include/exclude) can be configured.
When the user removes a cron strategy or a filter, it is automatically
removed from all configs so that there is no API failure (400 Bad
Request).

No code completion is not provided, but required attributes for filters
are automatically set on save to avoid API failure (500 Internal Server
Error).

A few words about order and sorting:
- openHAB Core seems to sort the cron strategies.
- Configurations itself are unsorted, they could be sorted
alphabetically by the UI.
- Items of configuration are sorted by their type (groups before normal
Items) as well as alphabetically.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Co-authored-by: J-N-K <github@klug.nrw>
2023-06-28 22:32:38 +02:00
lolodomo 7cb786aa51
[BasicUI] Set color-scheme for OH icon (#1937)
to have icon color depending on selected theme

Fix #1861

Will work only with SVG custom OH icons containing style="color-scheme:
light dark" and currentColor as fill color.

Signed-off-by : Laurent Garnier <lg.hc@free.fr>
2023-06-24 14:32:00 +02:00
openhab-bot a4b6203153
New Crowdin updates (#1873) 2023-06-24 01:14:53 +02:00
J-N-K d4acf720cc
Improvements to the add-on page (#1932)
- Hide author line if author not present
- Hide documentation line if documentation line not present
- Add correct provisioning information for jar file add-on service
- Properly handle description in add-on details page

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-06-18 19:55:54 +02:00
Mark Herwege 49de601b58
Sitemap parser: Fix negative numbers not allowed for visibility (#1928)
The sitemap DSL parser was not able to correctly recognize negative numbers.

Regression from https://github.com/openhab/openhab-webui/pull/1843 where explicit
recognition of hyphens was introduced for new icon syntax.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-06-18 19:06:56 +02:00
lolodomo 81e12f5f44
[HABot] Use SemanticsService to search for label/synonyms of a tag class (#1916)
Depends on openhab/openhab-core#3636

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-06-17 11:15:10 +02:00
Mark Herwege e75f001c35
[BasicUI] Adjust slider unit handling (#1922)
Adjust BasicUI slider unit handling.
So far, the unit was not passed on to the slider. With proposed changes
in core https://github.com/openhab/openhab-core/pull/3644, unit would be
passed and needs to stripped for the slider to work properly.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-06-14 11:42:23 +02:00
Florian Hotze f32b8a4363
`oh-slider` & `oh-knob`: Add option to ignore displayState (#1924)
Follow-up for #1920.

-- 
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-06-13 15:32:35 +02:00
Florian Hotze 7f6e093f01
`oh-slider` & `oh-knob`: Fix user configured unit (state description) ignored (#1920)
Fixes #1913. Fixes https://github.com/openhab/openhab-core/issues/3643.
Depends on https://github.com/openhab/openhab-core/pull/3647.

While fixing this, I also noticed a minor regression from PR #1894, that
I also fixed.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-06-13 14:21:56 +02:00
Florian Hotze b6393c2c37
`oh-repeater`: Fix `key` property does not refresh repeater (#1919)
Fixes #1918.
Regression from #1904.

-- 
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-06-13 09:40:50 +02:00
stefan-hoehn c5f2a9ff58
[blockly] Provide persistence service to blocks (#1903)
Fixes #1625.

Allows to provide the persistence type to persistence blocks.
Default can be provided instead of selecting a particular one (is
backward compatible to old blocks).
Either Iten name or Item can be provided (note that variables must have
the Item not the Item name as the type of variables cannot be detected).

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-06-12 18:21:08 +02:00
Wouter Born bff05be6f6
Upgrade maven-surefire-plugin to 3.0.0 (#1848)
This fixes deprecation warnings when runnings tests with Maven 3.9.x:

`[WARNING] Parameter 'localRepository' is deprecated core expression;
Avoid use of ArtifactRepository type. If you need access to local
repository, switch to '${repositorySystemSession}' expression and get
LRM from it instead.`

See: https://issues.apache.org/jira/browse/SUREFIRE-2154

Related to openhab/openhab-core#3512

Signed-off-by: Wouter Born <github@maindrain.net>
2023-06-11 22:13:01 +02:00
J-N-K a8ef9cc6e9
Remove "Other Services" section from main settings page (#1891)
Add-on service settings are configurable from the respective add-on's
page and therefore the "Other Services" section of the main settings
page is not needed anymore.
Services provided by openHAB core that were previously listed unter
"Other Services" were moved to "System Services".

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-06-04 12:23:08 +02:00
stefan-hoehn a47835933f
[blockly] Fix UoM variable support (#1911)
Fixes variable support for the blockly unit of measurement blocks which
did not work at all -> var defaults to item object.

Blockly cannot detect the type that is contained in a variable so we
expect an Item object.
This allows to iterate over a group of Item members which returns a list
of Item objects

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-29 14:21:02 +02:00
stefan-hoehn dab4630d08
Widget editor: Add minus as allowed char of widget uid (#1910)
Fixes #1906.

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-29 13:53:22 +02:00
J-N-K 21a30972a8
Add BasicUI to recommended add-ons (#1908)
See discussion in https://github.com/openhab/openhab-distro/pull/1543.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-25 20:49:12 +02:00
Florian Hotze b5176216c1
`oh-slider`: Fix command sent on state update due to rounding (#1894)
Fixes https://github.com/openhab/openhab-webui/issues/1862.

When a state update like 40.545 was received, the slider component
commanded the Item to 41 because of the rounding used.
Unfortunately, the slider component has no built-in way to avoid that.
This decouples the slider value from the actual Item value and only send
command when the difference between them is larger or equal than step
size.

This is no perfect solution, because it can be that the slider does not
accept input when the above checks don't pass.
Example: Your Item has a value of 40.545, then the slider does not
accept 40.5 and 41.

I've checked `oh-setpoint` and `oh-knob`, they are not affected by this
bug.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-22 20:53:12 +02:00
Florian Hotze a75cd04565
Item & Thing code tabs: Minor fixes (#1900)
- Item code tab: Fix lock icon always displayed.
- Thing code tab: Fix missing warning when leaving page but there are
unsaved changes.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-22 20:48:35 +02:00
Florian Hotze 63c122d5f5
`oh-repeater`: Fix new data requested when css visibility changed (#1904)
Fixes #1804.

The oh-repeater re-requested it's data on every CSS visibility change
because the data was asyncComputed. This makes the data load when the
component is created and then stores it.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-22 20:44:35 +02:00
Florian Hotze 0b555580ba
Items: Add `unit` metadata for UoM (`Number:`) Items (#1901)
Fixes #1890.

This adds the `unit` metadata from
https://github.com/openhab/openhab-core/pull/3481 to the pre-defined
metadata namespaces for UoM Items (Item type `Number:`) and provides a
metadata edit page for it.

Once https://github.com/openhab/openhab-core/pull/3611 is merged, the
Item create page will be adjusted to set the `unit` metadata to the
system default on Item creation.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-20 14:36:36 +02:00
Florian Hotze 388bedf1ff
`oh-knob`: Fix `releaseOnly` not working (#1893)
Regression from #1875.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-19 17:09:39 +02:00
stefan-hoehn 55c72349e8
[blockly] Show toast instead of error when saving / running from code preview (#1899)
Since the very beginning of Blockly a not very meaningful error message was alerted when the user attempted to run/save a Blockly from the code preview. 
This detects that situation and shows a nice toast instead of the cryptic error alert.

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-16 19:22:59 +02:00
stefan-hoehn ae4b729b29
[blockly] Add dictionary loop (#1898)
Fixes #1711.

This adds a new loop type which allows to iterate over a dictionary.

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-15 20:52:33 +02:00
stefan-hoehn c631470fd9
[blockly] Switch between Item name or label display (#1868)
This PR allows to show either the name or the label of the item.

Since the beginning the Item picker would show the label during
selection but the item block itself then would show the name (hence the
"id" that is used internally). This always confused me because I rather
remember the labels rather the "internal" names of the item. From the
implementation perspective it is now clear to me why this was done (it
was much easier to generate the code) and also it is consistent with
what is used for code generation.

This new way allows the user of the blockly editor to switch between showing
the label or the name while the code generation always uses the name.

Note that this requires both the name and the label stored in the
blockly code. Because the current code does not store the label, it
needs to repicked once, via the item picker, to retrieve that label and
then store it. I may add automatic retrieval for the label in the future
but due to some internal limitations it doesn't seem that easy to
provide clear code separation for that.

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-14 15:32:30 +02:00
lolodomo ca306c7a6d
[BasicUI] Handle properly state updates to NULL or UNDEF (#1897)
Live update to NULL state is no more ignored.
Live update to NULL or UNDEF is now properly handled by setpoint and
slider widgets.

Fix #1886

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-05-13 20:59:46 +02:00
Tobias Bräutigam 7b3490d613
[cometvisu] make sure that folder paths always end with a slash... (#1826)
... this fixes wrong backup/trash file creation

Signed-off-by: Tobias Bräutigam <tbraeutigam@gmail.com>
2023-05-13 19:20:42 +02:00
J-N-K 51081d45f4
[basic] Fix wrong addon id (#1892)
The Basic UI uses `basic` as add-on id, not `basicui`.

Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-05-13 11:42:14 +02:00
stefan-hoehn ed3685570f
Add blockly dev server start & Document npm run dev (#1888)
Add a npm run possibility to start dev server with blockly source easily
document npm run dev options

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-12 22:26:11 +02:00
stefan-hoehn bb8d4dde46
[blockly] Fix picker update detection to allow shadow block conversion (#1889)
Follow-up for #1877.

This improves the above PR which didn't capture the openHAB blocks for
shadow block conversion due to a small implementation issue in the Item,
Thing and date pickers.
Now all these three work fine as well.

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-11 17:03:02 +02:00
Florian Hotze 60221ab0b8
Transformation edit: Remove i18n string from Item state transform hint (#1883)
Follow-up for #1845.

The i18n identifier should not be part of the hint "How to use this
transformation for Item states".

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-09 20:51:14 +02:00
Florian Hotze 89d0403d80
Fix Things by binding & pages by type not in alphabetical order (#1884)
Fixes #792.
Fixes #1673.

This fixes the `Things by binding` and `pages by type` order to always
be alphentically.
These views only seemed to be alphabetically ordered in edge cases.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-09 20:46:44 +02:00
Florian Hotze a1929a68e2
`foreground-service`: Remove visibility change listener beforeDestroy (#1885)
... and check for foreground before starting foreground activity.

Follow-up for #1878.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-09 20:44:54 +02:00
Mark Herwege 54ed5fee15
Sitemap code generation: Quote colors (#1887)
The sitemap syntax requires colors in icon, label and valuecolors to be strings and have quotes around the values.
This is currently not respected, therefore the generated code could not be used without correction when copied into a sitemap file.

This fixes that bug.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-05-09 20:33:28 +02:00
lolodomo 3d8348aca9
[BasicUI] Add more examples of valid/invalid URLs in README (#1823)
Fixes #1805.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-05-09 12:07:21 +02:00
stefan-hoehn a4b0678a48
[blockly] Automatic shadow block conversion into real block (#1877)
This blockly plugin automatically converts a shadow block into a real block as soon as it is being edited.
This is very helpful in case the same block needs to be reused again and can therefore be copied.

Known issues: 
- this sometimes only works if the whole block is selected with the option "external inputs"
- unfortunately it also doesn't work with item and thing picker. Theroot cause remains to be seen and is currently being investigated with the blockly community.

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-07 16:20:43 +02:00
Florian Hotze b3a4318567
Enable dynamic icons only for some icon types in default list widget (#1874)
Follow-up for #1849.
--

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-07 15:22:46 +02:00
Florian Hotze a548e0d1f6
`foreground-service`: Listen to tab visibility change event (#1878)
Fixes #1872.

This makes the foreground service also listen to the `visibilitychange`
event to stop and resume foreground activity when the tab is changed or
the browser is closed.

See
https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-07 15:13:43 +02:00
Florian Hotze b9d57f04dc
`oh-sipclient`: Various fixes & improvements (#1857)
Closes #1690.
Closes #1691.

* Improves alert message shown when HTTP is used to clearly indicate
that the SIP widget will only work with HTTPS.
* Fixes an error thrown when the SIP widget was not properly initialized
and leaves foreground.
* Upgrades JsSIP.
* Improves styling to use 100% of available height.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-07 14:22:56 +02:00
Florian Hotze 52da897b33
`oh-knob` & `oh-stepper`: Add offset functionality (#1875)
Supersedes #1565.

This adds an offset parameter to the knob and stepper components, that
allows to add or subtract a number value to the displayed state of the
component.

This is useful for thermostats which have a fixed temperature of n and
are controlled with an offset to that temperature n, e.g. you have a KNX
HVAC system which has a fixed temperature of 20 °C: -2 would mean the
target temperature is 18 °C, +2 would mean that the target temperature
is 22 °C. By setting the offset parameter to 20, the UI will display the
real target temperature instead of the -2 or 2.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-07 14:20:42 +02:00
stefan-hoehn 46d256c553
[blockly] Add pattern to text of date block (#1869)
Closes #1636.

Allows the user to define a custom pattern for the text of date block.

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-07 14:02:29 +02:00
stefan-hoehn 12bd53b725
[blockly] Improvements for UoM blocks & Extend `getItemAttribute` block (#1864)
Closes #1841.
Closes #1791.

`getItemAttribute` block:
- add numeric state, quantity state
- improve tooltips
- set correct output typing

Unit of Measurement blocks: 
- add block to create Quantity out of Value and Unit
- add Qty to label to make appearance clearer
- Smart block input type detection to allow Quantity, Item and even
Item-Name as input and generate the right code from that

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-07 13:52:23 +02:00
stefan-hoehn 54aa3ab4e8
Developer sidebar: Support search in metadata value and config (#1876)
Improves developer sidebar search to even search within the metadata values and config object.

This e.g. allows you to search for all pattern settings in the `stateDescription` metadata.

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-07 13:49:14 +02:00
stefan-hoehn fa371993f1
[blockly] Add new `math_round` block with round up, down and by decimals (#1871)
Fixes #1303.

Replaces the original math_round block with a new one that adds rounding up, down and by given decimals.

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-07 01:09:05 +02:00
stefan-hoehn 8b3ace362f
[blockly] Support storing timers in shared cache (#1870)
Closes #1858.

Adds support for storing timers in the shared or the private cache (until now, private cache was default).
Timers in the shared cache can be managed by rules/scripts other than the one in which the timer was created.

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-05-06 23:59:57 +02:00
Mark Herwege cb253f6b4d
Sitemap and Item config parsing adjustments (#1843)
- Adapt sitemap and item lexers to changes in icon name syntax
- Restrict the elements that can be added to a sitemap
- Added extra sitemap validations (in line with xtext validation in
core)
- Added test for sitemap parser and validation

This solves the issue in main UI created by https://github.com/openhab/openhab-core/pull/3539 and https://github.com/openhab/openhab-core/pull/3378.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-05-05 11:02:35 +02:00
Florian Hotze 095bb2f9cb
Fix icons not displayed & not dynamic on all pages (#1849)
Fixes #1839.
Fixes #574.
Closes #1860.

* Fixes Item icon styling on the Item detail page.
* Add support for openHAB iconsets.
* Fix `oh:` icons not properly displayed in `default-list-item.vue`.
* Refactor `oh-icon` config & style binding.
* Enable real-time state on the semantic model page.
* Enable state for the channel link edit page.
* Enable dynamic icons in the settings where missing and possible
(semantic model page, channel link edit page, Item edit page when
setting category, Items list page).
* Enable dynamic icons in the default list widget for most Items except
some and update the docs accordingly.
* Add a refresh button to the Item list page.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-05-02 22:58:13 +02:00
stefan-hoehn 79fbc793e3
Use right UID attribute in Thing picker (#1865)
Thing picker sort uses wrong UID attribute as fallback during sort of
thing list.

Follow-up for #1837.

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
2023-04-30 11:02:56 +02:00
Wouter Born 0fd9b15fe6
Remove redundant modifiers from interfaces (#1847)
This removes redundant modifiers from the interfaces similar to
openhab/openhab-core#3560.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-04-20 19:00:03 +02:00
Florian Hotze 09bcedb30a
Add a code tab to the Item editor (#1818)
Closes #728.
See discussion in
https://github.com/openhab/openhab-webui/discussions/1737#discussioncomment-5130752.

Adds a YAML code tab to the Item editor as requested several times on
various places.
Editor hints are provided for Item types, groupTypes, groupNames and
metadata namespaces.

If the Item has been provisioned from file, the editor is read-only and
a big lock icon is displayed.

Note that metadata is currently not displayed, because mass-saving
metadata is not supported yet.

--
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2023-04-20 01:17:42 +02:00
Boris Krivonog 5ee7b28591
Evaluate service as part of series's chart config (#1852)
As discussed
https://community.openhab.org/t/widget-pass-persistence-service-as-property-to-custom-widget/146132
the `service` property of `series` is not evaluated:
```
- component: oh-chart
    config:
        ...
    slots:
      ...
      series:
        - component: oh-time-series
          config:
            service: =props.useInflux ? "influxdb":"rrd4j"
            ...
```

Signed-off-by: Boris Krivonog <boris.krivonog@inova.si>
2023-04-19 22:00:27 +02:00