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

[ui] Switch widget as default widget for Number or String items with command options #1422

Merged
merged 5 commits into from
Jun 6, 2020

Conversation

cweitkamp
Copy link
Contributor

  • Switch widget as default widget for Number or String items with command options

Closes #1016

Signed-off-by: Christoph Weitkamp github@christophweitkamp.de

@cweitkamp cweitkamp added enhancement An enhancement or new feature of the Core UI User Interface labels Apr 14, 2020
@cweitkamp
Copy link
Contributor Author

cweitkamp commented Apr 14, 2020

Together with openhab/openhab-webui#217 the rendering looks like this:

grafik

@lolodomo
Copy link
Contributor

I think that the default should remain a selection. The buttons are not adapted when you have 50 options !

@cweitkamp
Copy link
Contributor Author

I considered checking number of command options against MAX_BUTTON = 4 (see https://github.com/openhab/openhab-webui/blob/909226e2725caa6aa4aed59a61f6b57d8110f464/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/SwitchRenderer.java#L55) and use Switch element if less or equals and Selection element else. Wdyt?

@lolodomo
Copy link
Contributor

Yes, that would be ok IMHO to consider a max number of options to choose between switch or selection. 4 looks ok to me as a reasonable value.

…nd options

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
@cweitkamp cweitkamp force-pushed the feature-1016-command-options branch from e510b5f to f72408e Compare April 17, 2020 06:59
@cweitkamp
Copy link
Contributor Author

I added the check for maximum number of options.

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
@cweitkamp cweitkamp force-pushed the feature-1016-command-options branch from 3274e31 to 2172d63 Compare April 17, 2020 08:31
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

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

Thank you!

@wborn wborn merged commit f52af0b into openhab:master Jun 6, 2020
@cweitkamp cweitkamp deleted the feature-1016-command-options branch June 6, 2020 07:16
@cweitkamp cweitkamp added this to the 3.0 milestone Jun 25, 2020
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 11, 2023
…command options (openhab#1422)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
GitOrigin-RevId: f52af0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core UI User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rendering of command options
3 participants