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

Provide access to widget configuration from widget expressions #1698

Merged
merged 1 commit into from Feb 16, 2023

Conversation

florian-h05
Copy link
Contributor

Fixes #1025.

This introduces a new object for component configuration expressions to access the configuration of the component itself.

After this got merged, I can provide the docs update as well.

Signed-off-by: Florian Hotze florianh_dev@icloud.com

Fixes openhab#1025.

This introduces a new object for component configuration expressions to access the configuration of the component itself.

After this got merged, I can provide the docs update as well.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 requested a review from a team as a code owner February 10, 2023 11:56
@relativeci
Copy link

relativeci bot commented Feb 10, 2023

Job #758: Bundle Size — 15.97MiB (~-0.01%).

533b464(current) vs 74b7b79 main#757(baseline)

Metrics (1 change)
                 Current
Job #758
     Baseline
Job #757
Initial JS 1.73MiB(~-0.01%) 1.73MiB
Initial CSS 608.52KiB 608.52KiB
Cache Invalidation 90.48% 90.48%
Chunks 218 218
Assets 688 688
Modules 2010 2010
Duplicate Modules 108 108
Duplicate Code 1.77% 1.77%
Packages 135 135
Duplicate Packages 15 15
Total size by type (2 changes)
                 Current
Job #758
     Baseline
Job #757
CSS 856.56KiB 856.56KiB
Fonts 1.08MiB 1.08MiB
HTML 1.23KiB 1.23KiB
IMG 140.74KiB 140.74KiB
JS 9.01MiB (~-0.01%) 9.01MiB
Media 295.6KiB 295.6KiB
Other 4.62MiB (~-0.01%) 4.62MiB

View job #758 reportView main branch activity

@ghys
Copy link
Member

ghys commented Feb 12, 2023

Probably a good thing, but (I haven't tested or analyzed further) is there a possibility of infinite loops (if a config property contains an expression including config which would reevaluate the expressions in the config)?

@florian-h05
Copy link
Contributor Author

I haven‘t really though about that this way, I will check if there is that possibility.

@florian-h05
Copy link
Contributor Author

florian-h05 commented Feb 15, 2023

I have just checked this concern, in fact if you access a config property that contains some expression, the expression from this widget property isn't evaluated at all - which IMO is a good thing:

- component: oh-label-card
   config:
     title: =5+3/2
     footer: =config.title

image

Copy link
Member

@ghys ghys left a comment

Choose a reason for hiding this comment

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

Alright then!

@ghys ghys merged commit e760877 into openhab:main Feb 16, 2023
@florian-h05 florian-h05 deleted the widgets-access-config branch February 16, 2023 21:01
@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Feb 16, 2023
@florian-h05 florian-h05 added this to the 4.0 milestone Feb 16, 2023
florian-h05 added a commit to florian-h05/openhab-webui that referenced this pull request Feb 24, 2023
Follow-up for PR openhab#1698 where I forgot this.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
florian-h05 added a commit to florian-h05/openhab-webui that referenced this pull request Feb 24, 2023
Follow-up for PR openhab#1698 where I forgot this.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
ghys pushed a commit that referenced this pull request Mar 1, 2023
Follow-up for PR #1698 where I forgot this.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
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.

[Main UI] Provide access to widget properties from widget expressions
2 participants