Skip to content

Commit

Permalink
[sitemap] Press & release feature for buttons in a switch element
Browse files Browse the repository at this point in the history
Related to openhab/openhab-core#4183 and openhab/openhab-core#3822

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo committed May 7, 2024
1 parent 0a12122 commit 2311c00
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ui/sitemaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ Mappings is an optional parameter for the [Switch](#element-type-switch) and [Se
Mapping syntax:

```java
mappings=[value_1="description_1", value_2="description_2"=<iconname>, ...]
mappings=[value_1="description_1", value_2="description_2"=<iconname>, value_press:value_release="description_3", ...]
```

Examples:
Expand All @@ -605,6 +605,8 @@ mappings=[OFF="All heaters off"]
mappings=[15="Gone", 19="Chilly", 21="Cozy"]

mappings=[ON="Mic On"=material:mic, OFF="Mic Off"=material:mic_off]

mappings=[ON:OFF="On"]
```

As you can see, different Item data types are accepted as mappings values.
Expand All @@ -623,6 +625,9 @@ This limits the possible input values, which is yet another often occurring use
In the fifth example above, user interfaces will display buttons using the provided icon rather than the provided description.
Icons are usable in Switch element but ignored in Selection element.

In the sixth example above, as there are 2 commands provided separated by a semicolon, user interface will consider a press and release behavior, the first command (ON in the example) is sent to the item when the button is pressed and the second command (OFF in the example) is sent when the button is finally released.
This behavior is only applicable for a `Switch` element.

## Dynamic Sitemaps

All Sitemap elements can be configured to be hidden, color highlighted or to have a [dynamic icon]({{base}}/configuration/items.html#dynamic-icons), depending on certain Item states.
Expand Down

0 comments on commit 2311c00

Please sign in to comment.