Skip to content

Commit

Permalink
Extend item syntax for category/icon
Browse files Browse the repository at this point in the history
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, ...
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 icon source is assumed to be the openHAB server and the first segment is then the icon set and the second the icon name.
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 use a string containing anything has been removed.

Related to openhab#3052

Signed-off-by: Laurent Garnier <[email protected]>
  • Loading branch information
lolodomo committed Apr 11, 2023
1 parent 643fe49 commit e9453ba
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ItemModel:
ModelItem:
(ModelNormalItem | ModelGroupItem) name=ID
(label=STRING)?
('<' icon=(ID|STRING) '>')?
('<' icon=Icon '>')?
('(' groups+=ID (',' groups+=ID)* ')')?
('[' tags+=(ID|STRING) (',' tags+=(ID|STRING))* ']')?
('{' bindings+=ModelBinding (',' bindings+=ModelBinding)* '}')?
Expand Down Expand Up @@ -64,6 +64,22 @@ NUMBER returns ecore::EBigDecimal:
('-')? ID ('.' ID )?
;

Icon:
(IconSource ':' IconSet? ':' IconName) | (IconSet ':' IconName) | IconName
;

IconSource:
ID
;

IconSet:
ID
;

IconName:
ID
;

terminal ID: '^'?('a'..'z'|'A'..'Z'|'_'|'0'..'9') ('a'..'z'|'A'..'Z'|'_'|'-'|'0'..'9')*;

terminal STRING:
Expand Down

0 comments on commit e9453ba

Please sign in to comment.