fix for FS20 readings without value, e.g. on, off, dimup

git-svn-id: https://svn.fhem.de/fhem/trunk@156 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
neubert
2008-03-24 21:37:20 +00:00
parent d247be1b0c
commit cbb0dfd306

View File

@@ -109,18 +109,27 @@ DbLog_ParseEvent($$)
elsif($type eq "FS20") { elsif($type eq "FS20") {
@parts= split(/ /,$value); @parts= split(/ /,$value);
my $reading= $parts[0]; if(!defined($reading)) { $reading= ""; } my $reading= $parts[0]; if(!defined($reading)) { $reading= ""; }
$value= join(" ", shift @parts); if($#parts>=1) {
if($reading =~ m(^dim*%$)) { $value= join(" ", shift @parts);
$value= substr($reading,3,length($reading)-4); if($reading =~ m(^dim*%$)) {
$reading= "dim"; $value= substr($reading,3,length($reading)-4);
$unit= "%"; $reading= "dim";
$unit= "%";
}
else {
$value= "";
}
} }
} }
# FHT # FHT
elsif($type eq "FHT") { elsif($type eq "FHT") {
if($reading =~ m(-temp)) { $value=~ s/ \(Celsius\)//; $unit= "°C"; } if($reading =~ m(-temp)) { $value=~ s/ \(Celsius\)//; $unit= "°C"; }
if($reading =~ m(temp-offset)) { $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 # KS300
elsif($type eq "KS300") { elsif($type eq "KS300") {