Skip to content
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

Widget expressions: Add # as a shorthand for item.numericState #2441

Merged
merged 3 commits into from
Mar 2, 2024

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Mar 2, 2024

See: openhab/openhab-core#4123

Add # alongside the existing shorthands:

@'ItemName' => items.ItemName.state
@@'ItemName' => items.ItemName.displayState
#'ItemName' => items.ItemName.numericState

Yes, the docs will be updated if/after this is merged.

@jimtng jimtng requested a review from a team as a code owner March 2, 2024 06:41
Copy link

relativeci bot commented Mar 2, 2024

Job #1759: Bundle Size — 11.13MiB (~+0.01%).

3f9bd76(current) vs 64a1e0a main#1756(baseline)

Warning

Bundle contains 19 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
Job #1759
     Baseline
Job #1756
Regression  Initial JS 1.84MiB(~+0.01%) 1.84MiB
No change  Initial CSS 607.88KiB 607.88KiB
Change  Cache Invalidation 16.53% 16.77%
No change  Chunks 220 220
No change  Assets 243 243
No change  Modules 3091 3091
No change  Duplicate Modules 164 164
No change  Duplicate Code 1.75% 1.75%
No change  Packages 151 151
No change  Duplicate Packages 18 18
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #1759
     Baseline
Job #1756
Regression  JS 9.31MiB (~+0.01%) 9.31MiB
Not changed  CSS 889.35KiB 889.35KiB
Not changed  Fonts 526.1KiB 526.1KiB
Not changed  Media 295.6KiB 295.6KiB
Not changed  IMG 140.74KiB 140.74KiB
Not changed  HTML 1.24KiB 1.24KiB
Not changed  Other 871B 871B

View job #1759 reportView jimtng:numericstate-shortcut branch activityView project dashboard

@florian-h05
Copy link
Contributor

Would ## be more consistent?

@jimtng
Copy link
Contributor Author

jimtng commented Mar 2, 2024

Would ## be more consistent?

It's a matter of opinion, I guess. I'd rather it be a single # to save typing. Two ## would indicate there's a version with one # too?

I picked # because it's often used as "number" e.g. "My #1 OS is Linux" whereas ## doesn't sound as nice

Signed-off-by: Jimmy Tanagra <[email protected]>
Signed-off-by: Jimmy Tanagra <[email protected]>
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks 👍
Just in time for the first milestone of openHAB 4.2.0 🙌

@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Mar 2, 2024
@florian-h05 florian-h05 added this to the 4.2 milestone Mar 2, 2024
@florian-h05 florian-h05 changed the title MainUI: Add # as a shorthand for item.numericState Widget expressions: Add # as a shorthand for item.numericState Mar 2, 2024
@florian-h05 florian-h05 merged commit 90223e9 into openhab:main Mar 2, 2024
6 checks passed
@jimtng jimtng deleted the numericstate-shortcut branch March 2, 2024 13:43
florian-h05 added a commit to florian-h05/openhab-docs that referenced this pull request Mar 29, 2024
stefan-hoehn pushed a commit to openhab/openhab-docs that referenced this pull request Mar 29, 2024
* Widget expressions Add docs for `#` shortcut

Refs openhab/openhab-webui#2441.

Signed-off-by: Florian Hotze <[email protected]>

* Address review

Signed-off-by: Florian Hotze <[email protected]>

* Fix markdownlint

Signed-off-by: Florian Hotze <[email protected]>

---------

Signed-off-by: Florian Hotze <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants