From 8e25ad7e18a1e8640bb71a35bfaa692993c9c56f Mon Sep 17 00:00:00 2001 From: neubert Date: Mon, 24 Mar 2008 21:37:20 +0000 Subject: [PATCH] fix for FS20 readings without value, e.g. on, off, dimup git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@156 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- contrib/dblog/93_DbLog.pm | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/contrib/dblog/93_DbLog.pm b/contrib/dblog/93_DbLog.pm index 01ee1ee6d..39d8c0930 100755 --- a/contrib/dblog/93_DbLog.pm +++ b/contrib/dblog/93_DbLog.pm @@ -109,18 +109,27 @@ DbLog_ParseEvent($$) elsif($type eq "FS20") { @parts= split(/ /,$value); my $reading= $parts[0]; if(!defined($reading)) { $reading= ""; } - $value= join(" ", shift @parts); - if($reading =~ m(^dim*%$)) { - $value= substr($reading,3,length($reading)-4); - $reading= "dim"; - $unit= "%"; + if($#parts>=1) { + $value= join(" ", shift @parts); + if($reading =~ m(^dim*%$)) { + $value= substr($reading,3,length($reading)-4); + $reading= "dim"; + $unit= "%"; + } + else { + $value= ""; + } } } # FHT elsif($type eq "FHT") { if($reading =~ m(-temp)) { $value=~ s/ \(Celsius\)//; $unit= "°C"; } if($reading =~ m(temp-offset)) { $value=~ s/ \(Celsius\)//; $unit= "°C"; } - if($reading eq "actuator") { $value=~ s/%//; $value= $value*1.; $unit= "%"; } + if($reading eq "actuator") { + # TODO: 2008-03-24 currently something wrong: + # "actuator: lime-protection" + $value=~ s/%//; $value= $value*1.; $unit= "%"; + } } # KS300 elsif($type eq "KS300") {