diff --git a/fhem/CHANGED b/fhem/CHANGED index 3a8d20c46..483a4e4bb 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 01_FHEMWEB: add cmdIcon - bugfix: 10_pilight_ctrl: set reset - lost connection to submodules - bugfix: 70_Pushalot: corrected parameter order for image - change: 70_Pushalot: changed http call to non-blocking diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 021eeec55..4f08c3d4a 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -176,7 +176,7 @@ FHEMWEB_Initialize($) ############### # Initialize internal structures - map { addToAttrList($_) } ( "webCmd", "icon", "devStateIcon", + map { addToAttrList($_) } ( "webCmd", "icon", "cmdIcon", "devStateIcon", "widgetOverride", "sortby", "devStateStyle"); InternalTimer(time()+60, "FW_closeInactiveClients", 0, 0); @@ -1435,6 +1435,10 @@ FW_showRoom() # Commands, slider, dropdown my $smallscreenCommands = AttrVal($FW_wname, "smallscreenCommands", ""); if((!$FW_ss || $smallscreenCommands) && $cmdlist) { + my @a = split("[: ]", AttrVal($d, "cmdIcon", "")); + Log 1, "ERROR: bad cmdIcon definition for $d" if(@a % 2); + my %cmdIcon = @a; + foreach my $cmd (split(":", $cmdlist)) { my $htmlTxt; my @c = split(' ', $cmd); # @c==0 if $cmd==" "; @@ -1452,7 +1456,9 @@ FW_showRoom() FW_pO $htmlTxt; } else { - FW_pH "cmd.$d=set $d $cmd$rf", $cmd, 1, "col3"; + my $nCmd = $cmdIcon{$cmd} ? + FW_makeImage($cmdIcon{$cmd},$cmd,"webCmd") : $cmd; + FW_pH "cmd.$d=set $d $cmd$rf", $nCmd, 1, "col3"; } } } @@ -3136,6 +3142,16 @@ FW_widgetOverride($$)
+ +
  • cmdIcon
    + Space separated list of cmd:iconName pairs. If set, the webCmd text is + replaced with the icon. An easy method to set this value is to use + "Extend devStateIcon" in the detail-view, and copy its value.
    + Example: +

  • +
  • devStateIcon
    First form:
    @@ -3799,6 +3815,17 @@ FW_widgetOverride($$) da ist, der Gerätename selbst.

  • + +
  • cmdIcon
    + Leerzeichen getrennte Auflistung von cmd:iconName Paaren. + Falls gesetzt, wird das webCmd text durch den icon gesetzt. + Em einfachsten setzt man cmdIcon indem man "Extend devStateIcon" im + Detail-Ansicht verwendet, und den Wert nach cmdIcon kopiert.
    + Beispiel: +

  • +
  • devStateIcon
    Erste Variante: