Extend sitemap syntax for icon (#3378)

The icon value can now contain until 3 segments separated by a semi-column.
First segment is the icon source. Example: oh, if, iconify, material, f7, ...
Second segment is the icon set (and can be empty). Example: classic
Third segment is the icon name (and can contain hyphen). Example: temperature

In case only two segments are provided, the first segment is the icon source and the second the icon name. "classic" icon set is assumed if icon source is "oh".
In case only one segment is provided, the icon source is assumed to be the openHAB server and its classic icon set and the value is then the icon name.

Ability to surround the value with simple or double quotes is kept for better backward compatibility.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
pull/3545/head
lolodomo 2023-04-12 17:42:06 +02:00 committed by GitHub
parent 953c08c367
commit fa37a467ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -156,7 +156,11 @@ GroupItemRef:
ID;
Icon returns ecore::EString:
STRING | ID;
STRING | (ID ':' (ID ':')?)? IconName;
// Allow hyphen inside an icon name
IconName:
(ID '-')* ID;
ColorArray:
((item=ID)? (condition=('==' | '>' | '<' | '>=' | '<=' | '!='))? (sign=('-' | '+'))? (state=XState) '=')?