mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 06:36:04 +00:00
01_FHEMWEB.pm: add cmdIcon
git-svn-id: https://svn.fhem.de/fhem/trunk@8735 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2510bd6f94
commit
2fb65ec32c
@ -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
|
||||
|
@ -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($$)
|
||||
</li>
|
||||
<br>
|
||||
|
||||
<a name="cmdIcon"></a>
|
||||
<li>cmdIcon<br>
|
||||
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.<br>
|
||||
Example:<ul>
|
||||
attr lamp cmdIcon on:control_centr_arrow_up off:control_centr_arrow_down
|
||||
</ul>
|
||||
</li><br>
|
||||
|
||||
<a name="devStateIcon"></a>
|
||||
<li>devStateIcon<br>
|
||||
First form:<br>
|
||||
@ -3799,6 +3815,17 @@ FW_widgetOverride($$)
|
||||
da ist, der Gerätename selbst.
|
||||
</li><br>
|
||||
|
||||
<a name="cmdIcon"></a>
|
||||
<li>cmdIcon<br>
|
||||
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.<br>
|
||||
Beispiel:<ul>
|
||||
attr lamp cmdIcon on:control_centr_arrow_up off:control_centr_arrow_down
|
||||
</ul>
|
||||
</li><br>
|
||||
|
||||
<a name="devStateIcon"></a>
|
||||
<li>devStateIcon<br>
|
||||
Erste Variante:<br>
|
||||
|
Loading…
x
Reference in New Issue
Block a user