diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 7aa4226c6..58ef02cd5 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -1399,7 +1399,10 @@ FW_showRoom() FW_pF "\n", ($row&1)?"odd":"even"; my $devName = AttrVal($d, "alias", $d); - $devName = eval $nameDisplay if(defined($nameDisplay)); + if(defined($nameDisplay)) { + my ($DEVICE, $ALIAS) = ($d, $devName); + $devName = eval $nameDisplay; + } my $icon = AttrVal($d, "icon", ""); $icon = FW_makeImage($icon,$icon,"icon") . " " if($icon); @@ -3006,11 +3009,11 @@ FW_widgetOverride($$)
  • nameDisplay
    The argument is perl code, which is executed for each single device in - the room to determine the name displayed. $d is the name of the current - device, and $devName is the value of the alias attribute or the name of - the device, if no alias is set. E.g. you can add a a global userattr - named alias_hu for the Hungarian translation, and specify nameDisplay - for the hungarian FHEMWEB instance as + the room to determine the name displayed. $DEVICE is the name of the + current device, and $ALIAS is the value of the alias attribute or the + name of the device, if no alias is set. E.g. you can add a a global + userattr named alias_hu for the Hungarian translation, and specify + nameDisplay for the hungarian FHEMWEB instance as @@ -3679,15 +3682,16 @@ FW_widgetOverride($$) Komma getrennte Liste; diese Links werden im linken Menü angezeigt. Beispiel:
    attr WEB menuEntries fhem.de,http://fhem.de,culfw.de,http://culfw.de
    - attr WEB menuEntries AlarmOn,http://fhemhost:8083/fhem?cmd=set%20alarm%20on
    + attr WEB menuEntries + AlarmOn,http://fhemhost:8083/fhem?cmd=set%20alarm%20on

  • nameDisplay
    Das Argument ist Perl-Code, was für jedes Gerät in der Raum-Übersicht ausgeführt wird, um den angezeigten Namen zu - berechnen. Dabei kann man die Variable $d für den aktuellen - Gerätenamen, und $devName für den aktuellen alias bzw. Name, + berechnen. Dabei kann man die Variable $DEVICE für den aktuellen + Gerätenamen, und $ALIAS für den aktuellen alias bzw. Name, falls alias nicht gesetzt ist, verwenden. Z.Bsp. für eine FHEMWEB Instanz mit ungarischer Anzeige fügt man ein global userattr alias_hu hinzu, und man setzt nameDisplay für diese FHEMWEB