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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>