openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

[sitemap] Buttongrid as container for new Button elements

Open lolodomo opened this issue 1 year ago • 1 comments

Related to #4173

Signed-off-by: Laurent Garnier [email protected]

lolodomo avatar May 08 '24 10:05 lolodomo

The proposed syntax for the Button is :

Button item=<item> [label=<label>] [icon=<icon>] row=<row> column=<column> [stateless] click=<cmd> [release=<cmd>] [labelcolor=[...]] [iconcolor=[...]] [visibility=[...]]
Button item=<item> [label=<label>] [staticIcon=<icon>] row=<row> column=<column> [stateless] click=<cmd> [release=<cmd>] [labelcolor=[...]] [iconcolor=[...]] [visibility=[...]]
Button item=<item> [label=<label>] [icon=[...]] row=<row> column=<column> [stateless] click=<cmd> [release=<cmd>] [labelcolor=[...]] [iconcolor=[...]] [visibility=[...]]

Explanations of the parameters:

  • The position of the button in the grid is defined by the row and column parameters.
  • The label parameter defines the text to display in the button. If not present, the value of the command (click parameter) is used as text.
  • The icon parameter defines the icon to display in the button. If not present, the button will contain a text. The icon can be dynamic by defining rules in the icon parameter.
  • By default, a button is stateful. It is stateless if stateless parameter is present.
  • A button is a click button by default, the command to send to the item is defined by the click parameter. Press & release behaviour is possible by setting the click and release parameters.
  • Label and icon color can be dynamic using the labelcolor and iconcolor parameters.
  • Visibility of the button can be dynamic using the visibility parameter.

Such Button element is valid only inside a Buttongrid element.

lolodomo avatar May 09 '24 12:05 lolodomo