mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-07 22:29:19 +00:00
devStateIcon with perl-expression
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@2804 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e6b837692e
commit
f99b0a8b2f
@ -2266,6 +2266,7 @@ FW_dev2image($)
|
|||||||
my $icon;
|
my $icon;
|
||||||
my $devStateIcon = AttrVal($name, "devStateIcon", undef);
|
my $devStateIcon = AttrVal($name, "devStateIcon", undef);
|
||||||
if(defined($devStateIcon)) {
|
if(defined($devStateIcon)) {
|
||||||
|
return $devStateIcon if($devStateIcon =~ m/^{.*}$/);
|
||||||
my @list = split(" ", $devStateIcon);
|
my @list = split(" ", $devStateIcon);
|
||||||
foreach my $l (@list) {
|
foreach my $l (@list) {
|
||||||
my ($re,$iconName) = split(":", $l);
|
my ($re,$iconName) = split(":", $l);
|
||||||
@ -2483,7 +2484,13 @@ FW_devState($$)
|
|||||||
} else {
|
} else {
|
||||||
my $icon;
|
my $icon;
|
||||||
$icon = FW_dev2image($d);
|
$icon = FW_dev2image($d);
|
||||||
$txt = FW_makeImage($icon, $txt) if($icon);
|
if($icon) {
|
||||||
|
if($icon =~ m/^{.*}$/) {
|
||||||
|
$txt = AnalyzePerlCommand(undef, $icon);
|
||||||
|
} else {
|
||||||
|
$txt = FW_makeImage($icon, $txt);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$txt = "<div id=\"$d\" align=\"center\" class=\"col2\">$txt</div>";
|
$txt = "<div id=\"$d\" align=\"center\" class=\"col2\">$txt</div>";
|
||||||
@ -2897,6 +2904,8 @@ FW_htmlEscape($)
|
|||||||
|
|
||||||
<a name="devStateIcon"></a>
|
<a name="devStateIcon"></a>
|
||||||
<li>devStateIcon<br>
|
<li>devStateIcon<br>
|
||||||
|
First form:<br>
|
||||||
|
<ul>
|
||||||
Space separated list of regexp/icon-name pairs. If the state of the
|
Space separated list of regexp/icon-name pairs. If the state of the
|
||||||
device matches regexp, then the corresponding icon-name will be
|
device matches regexp, then the corresponding icon-name will be
|
||||||
displayed. If icon-name does not exist in the fhem/www/images
|
displayed. If icon-name does not exist in the fhem/www/images
|
||||||
@ -2908,6 +2917,12 @@ FW_htmlEscape($)
|
|||||||
attr lamp devStateIcon .*:noIcon<br>
|
attr lamp devStateIcon .*:noIcon<br>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
</ul>
|
||||||
|
Second form:<br>
|
||||||
|
<ul>
|
||||||
|
Perl regexp enclosed in {}. Example:<br>
|
||||||
|
{'<div style="width:32px;height:32px;background-color:green"></div>'}
|
||||||
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<a name="webCmd"></a>
|
<a name="webCmd"></a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user