Commit Graph

173 Commits

Author SHA1 Message Date
lolodomo
3b9a97101b
[sitemap] Buttongrid as container for new Button elements (#4223)
Related to #4173

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-05-18 14:51:39 +02:00
lolodomo
965e7311eb
[sitemap] Do not try to convert item state into OnOffType for Switch widget if item has options (#4226)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-05-13 22:20:59 +02:00
Mark Herwege
d083a5379c
Support press and release buttons in sitemap generator (#4204)
* handle quoted arguments
* press and release mapping

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-05-05 22:16:36 +02:00
lolodomo
21186d6168
Use option label when formatting the option label with the provided pattern fails (#4205)
Issue discussed in openhab/openhab-android#3623

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-05-01 17:33:38 +02:00
Holger Friedrich
b563f1577a
More instanceof pattern matching (#4191)
* More instanceof pattern matching

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2024-04-21 21:22:37 +02:00
lolodomo
619762a297
[sitemap] Extend chart periods to cover past and future (#4172)
* [sitemap] Extend chart periods to cover past and future

Closes openhab/openhab-webui#2518

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-04-07 10:51:24 +02:00
lolodomo
a906d09b40
[sitemap] Add releaseOnly parameter to Slider sitemap element (#4084)
Related to #3430

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-02-12 20:12:19 +01:00
Wouter Born
85056d9d7b
Some more code cleanup (#4021)
This cleanup includes:

* Use enhanced for loops
* Use text blocks
* Use Objects.equals
* Fix some typos
* Remove redundant variable initialization
* Remove redundant null checks with instanceof
* Remove redundant thrown Exceptions
* Remove redundant empty String concatenation

Signed-off-by: Wouter Born <github@maindrain.net>
2024-02-04 11:17:55 +01:00
Wouter Born
2babea4c9a
Update license headers to 2024 (#4011)
Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-03 21:20:34 +01:00
Wouter Born
afd1d4726c
Iterate using Map entries (#4003)
* Iterate using Map entries

Iteration using Map entries is preferred because it is more efficient and helps preventing NPEs.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-03 14:50:50 +01:00
Wouter Born
106c8b2270
Remove unnecessary semicolons (#4009)
This helps with stopping the proliferation of unnecessary semicolons.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-03 13:47:23 +01:00
Wouter Born
58a106d36d
Use diamond operator (#4001)
Often the type can be inferred so the diamond operator can be used to simplify the code.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-03 08:22:43 +01:00
Wouter Born
dc5f50db63
Fix assertEquals order (#3995)
The first parameter should be the expected value and the second parameter the actual value.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-02 22:27:53 +01:00
Mark Herwege
dbc3b19a4f
fix empty rule condition (#3993)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2024-01-02 19:51:11 +01:00
Wouter Born
041e3b5127
Remove redundant modifiers (#4000)
Removes redundant modifiers from the code.
These modifiers redeclare the default modifiers that apply to interfaces, enums etc.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-02 19:29:29 +01:00
Wouter Born
89b67adbd7
Use isEmpty instead of 0 comparisons (#3999)
`isEmpty()` expresses the intent more clearly and is therefore preferred.
Counting the number of elements can also be an expensive operation e.g. when using linked lists.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-02 18:47:36 +01:00
lolodomo
8b14d56e2e
[sitemap] Fix parsing of button (buttongrid element built with MainUI) (#3980)
Fix openhab/openhab-webui#2242

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-12-30 15:57:52 +01:00
Wouter Born
ba5647b871
More code cleanups (#3975)
While cleaning up the code I found a some more code to cleanup:

* Remove unnecessary boxing
* Use `contains(..)` instead of `indexOf(..) != -1`
* Use `assertInstanceOf` in tests
* Make expensive trace logging conditional
* Remove redundant constructor
* Replace `collect(Collectors.toUnmodifiableList())` with `toList()`
* Replace `filter(..).count() == 0L` with `noneMatch(..)`
* Replace `filter(..).count() > 0` with `anyMatch(..)`

Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-28 13:15:50 +01:00
Wouter Born
e958d5b46a
Replace lambdas with method references (#3972)
Method references are more readable because they refer to class names and usually result in less code.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-28 09:55:31 +01:00
Wouter Born
ec05a63738
Remove unnecessary boxing (#3969)
Using primitives makes the code faster and consume less memory.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-27 17:50:09 +01:00
Holger Friedrich
839ba1ab4c
Apply spotless after release, resolve bundles (#3953)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-12-22 23:14:28 +01:00
openhab-bot
3b279587b1 [unleash-maven-plugin] Preparation for next development cycle. 2023-12-22 11:48:43 +00:00
lolodomo
d7486a985e
Sitemap generator: fix button parsing for Buttongrid (#3938)
Fix #3937

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-12-20 09:46:41 +01:00
lolodomo
76b10ac1c1
[Sitemap] Change syntax for Buttongrid sitemap element (#3898)
Follow-up #3810

Location in the grid is now defined by a row number and a column number.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-12-05 21:50:58 +01:00
lolodomo
f71ebfb83c
Extend support to ISO8601 format for sitemap chart period parameter (#3863)
* Extend support to ISO8601 format for sitemap chart period parameter

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-11-24 16:53:10 +01:00
Holger Friedrich
9ad2fef549
Fix javadoc warnings (#3870)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-11-15 09:21:07 +01:00
maniac103
fb6f1923e8
[sitemap] Provide information about widget label source to clients (#3804)
* [sitemap] Provide information about widget label source to clients

The label can be populated from a label specified on the respective
sitemap widget, or (if no label was specified) from the label of the
backing item. Allow clients to differentiate between both cases.

Related to openhab/openhab-webui#2065

Signed-off-by: Danny Baumann <dannybaumann@web.de>
2023-11-06 21:40:36 -08:00
Mark Herwege
d75d6dffce
Fix UI defined sitemaps (#3850)
* fix UI defined sitemaps
* allow AND conditions
* label not required

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-10-26 23:30:17 +02:00
lolodomo
7281dca286
[Sitemap] Add optional conditional rules for icon (#3820)
This allows dynamic icons based on items states even with non OH icon sources.
This also allows overwritting the default handling with state done by the icon servlet.

Example: icon=[item1>0=temperature,==0=material:settings,f7:house]

Related to openhab/openhab-webui#1938

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-10-15 22:00:35 +02:00
Wouter Born
e8e1c9fe73
Simplify code that creates List, Map and Set objects (#3836)
Simplifies the code by using List.of, List.copyOf etc. where possible which results in less code and imports.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-10-09 18:00:00 +02:00
lolodomo
e5518b9322
[Sitemap] Add support for multiple AND conditions (#3819)
Concerns labelcolor, valuecolor and visibility

Also fix wrong positions of ")" in Sitemap.xtext

Closes #3058

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-10-08 09:48:58 +02:00
lolodomo
f7d176570c
[Sitemap] Accept an optional icon for each value/label mapping (#3809)
* [Sitemap] Accept an optional icon for each value/label mapping

When set by the user, the icon can be used by UIs for switch element with mappings to render a button with the icon rather than the label.

Related to #3441

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-10-02 09:36:23 +02:00
Mark Herwege
3eef2872f5
fix trailing space in state string (#3812)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-10-01 21:47:25 +02:00
lolodomo
366bffa406
[Sitemap] Introduce "Buttongrid" as new sitemap element (#3810)
Related to #3441

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-10-01 21:36:31 +02:00
lolodomo
369a49aab1
[sitemap/MainUI] Fix a typo in buildWidget (#3811)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-10-01 16:38:38 +02:00
Mark Herwege
096d11bf3f
Fix sitemap visibility rule with blanks (#3769)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-08-26 15:10:10 +02:00
lolodomo
c12067a63b
[sitemap] Add new "staticIcon" parameter (#3735)
When set, the UI should not provide the item state when requestiong the
OH icon and should not request again the icon when the item state is
updated.

Related to openhab/openhab-android#3404

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-08-13 19:36:41 +02:00
Kai Kreuzer
5692232e2b Apply spotless
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-07-24 01:11:37 +02:00
openhab-bot
fd93f0a766 [unleash-maven-plugin] Preparation for next development cycle. 2023-07-23 17:14:35 +00:00
Flole998
5449c476e0
Provide correct version information for XChart in NOTICE (#3721)
Signed-off-by: Flole <flole@flole.de>
2023-07-21 22:07:20 +02:00
Kai Kreuzer
7a87001f98
Revert "Upgrade XChart to 3.8.4 (#3291)" (#3720)
This reverts commit c2e81a13fd.
2023-07-21 17:21:14 +02:00
lolodomo
f71137331f
[Sitemap UI] Do not break format defined in label with extra spaces (#3708)
Fix openhab/openhab-webui#1953

Fix a regression introduced by PR #3644

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-07-17 17:58:01 +02:00
lolodomo
b2934ad044
Avoid warning log introduced by PR #3644 (#3686)
Fix openhab/openhab-webui#1951

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-07-05 20:15:10 +02:00
Mark Herwege
5ceaa64768
[rest] Add widget state pattern and default unit to ItemUIRegistry (#3644)
* expose widget format pattern to sitemap REST
* Add unit fields to sitemap REST

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-07-02 11:03:00 +02:00
J-N-K
c2e81a13fd
Upgrade XChart to 3.8.4 (#3291)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-06-17 11:00:39 +02:00
Wouter Born
3c6d855d4b
Remove redundant public and abstract modifiers from interfaces (#3560)
* Remove redundant public modifiers from interfaces
* Remove redundant abstract modifiers from interfaces

Signed-off-by: Wouter Born <github@maindrain.net>
2023-04-20 20:22:58 +02:00
Holger Friedrich
769aa562a1
Code cleanup: Use Java 17 features (#3522)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-04-16 21:43:59 +02:00
Mark Herwege
44a146f5a8
Add Input widget to main UI sitemap configuration and REST API (#3431)
* add input widget to UI SitemapProviderImpl
* inputHint in UIComponentSitemapProvider
* add input element to REST

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2023-04-13 20:04:47 +02:00
Wouter Born
56f5550e6b
Fix broken ProxyServletService (#3436)
Reverts the partially working Whiteboard config changes of #3252 back to a working implementation using the HttpService.
The configurable threading makes this a non-trivial Servlet for use with the Whiteboard.

Fixes openhab/openhab-webui#1782

Signed-off-by: Wouter Born <github@maindrain.net>
2023-03-08 20:07:59 +01:00
lolodomo
6d989ea6e2
Remove List element from sitemap syntax (#3423)
Related to openhab/openhab-webui#1755
Related to openhab/openhab-android#3285

This sitemap widget is not documented.

It is not implemented neither in Android app nor iOS app.

It was implemented in BasicUI but was buggy.
Support in BasicUI has been removed.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2023-03-05 20:48:06 +01:00