From 32a4485d7e23e9e18e3d0cfc7fe7110ceeab8caa Mon Sep 17 00:00:00 2001 From: mfr69bs Date: Mon, 22 Oct 2012 22:05:48 +0000 Subject: [PATCH] FHEMWEB: support for model specific icons added git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2008 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/01_FHEMWEB.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/FHEM/01_FHEMWEB.pm b/FHEM/01_FHEMWEB.pm index 6f0293eff..102bd6ff0 100755 --- a/FHEM/01_FHEMWEB.pm +++ b/FHEM/01_FHEMWEB.pm @@ -2210,18 +2210,22 @@ FW_dev2image($) my ($type, $state) = ($d->{TYPE}, $d->{STATE}); return "" if(!$type || !defined($state)); + my $model = $attr{$name}{model} if(defined($attr{$name}{model})); + my (undef, $rstate) = ReplaceEventMap($name, [undef, $state], 0); $state =~ s/ .*//; # Want to be able to have icons for "on-for-timer xxx" my $icon; - $icon = FW_getIcon("$name.$state") if(!$icon); # lamp.Aus.png - $icon = FW_getIcon("$name.$rstate") if(!$icon); # lamp.on.png - $icon = FW_getIcon($name) if(!$icon); # lamp.png - $icon = FW_getIcon("$type.$state") if(!$icon); # FS20.Aus.png - $icon = FW_getIcon("$type.$rstate") if(!$icon); # FS20.on.png - $icon = FW_getIcon($type) if(!$icon); # FS20.png - $icon = FW_getIcon($state) if(!$icon); # Aus.png - $icon = FW_getIcon($rstate) if(!$icon); # on.png + $icon = FW_getIcon("$name.$state") if(!$icon); # lamp.Aus.png + $icon = FW_getIcon("$name.$rstate") if(!$icon); # lamp.on.png + $icon = FW_getIcon($name) if(!$icon); # lamp.png + $icon = FW_getIcon("$model.$state") if(!$icon && $model); # HM-OU-LED16.off.png + $icon = FW_getIcon($model) if(!$icon && $model); # HM-OU-LED16.png + $icon = FW_getIcon("$type.$state") if(!$icon); # FS20.Aus.png + $icon = FW_getIcon("$type.$rstate") if(!$icon); # FS20.on.png + $icon = FW_getIcon($type) if(!$icon); # FS20.png + $icon = FW_getIcon($state) if(!$icon); # Aus.png + $icon = FW_getIcon($rstate) if(!$icon); # on.png return $icon; }