From 4c113709c2973b19e22cabdacabe10b8518deb3c Mon Sep 17 00:00:00 2001 From: m_fischer <> Date: Sat, 19 Dec 2009 12:10:31 +0000 Subject: [PATCH] 21_OWTEMP.pm: bugfixing git-svn-id: https://svn.fhem.de/fhem/trunk@516 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 3 ++- fhem/FHEM/21_OWTEMP.pm | 24 ++++++++++-------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 6f07b179a..b878a3774 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -559,4 +559,5 @@ - bugfix: 21_OWTEMP.pm missing trigger fo notify/filelog (M.Fischer) - feature: 99_getstate.pm get state from S555TH now (M.Fischer) - feature: pgm3: automatic support for CUL_WS (S300TH) added (MartinH) - + - bugfix: 21_OWTEMP.pm missing space within state logging (M.Fischer) + - bugfix: 21_OWTEMP.pm interval fixed (M.Fischer) diff --git a/fhem/FHEM/21_OWTEMP.pm b/fhem/FHEM/21_OWTEMP.pm index 2539247d0..2c3bd98c8 100644 --- a/fhem/FHEM/21_OWTEMP.pm +++ b/fhem/FHEM/21_OWTEMP.pm @@ -154,23 +154,23 @@ OWTEMP_GetUpdate($$) $warn = "templow"; $hash->{ALARM} = "1"; $ret = OWTEMP_UpdateReading($hash,"warnings",$now,"",$warn); - $alarm = "A: ".$hash->{ALARM}; + $alarm = $hash->{ALARM}; } elsif ($temp >= $hash->{READINGS}{temphigh}{VAL}) { $warn = "temphigh"; $hash->{ALARM} = "1"; $ret = OWTEMP_UpdateReading($hash,"warnings",$now,"",$warn); - $alarm = "A: ".$hash->{ALARM}; + $alarm = $hash->{ALARM}; } else { $ret = OWTEMP_UpdateReading($hash,"warnings",$now,"",$warn); - $alarm = "A: ".$hash->{ALARM}; + $alarm = $hash->{ALARM}; } $hash->{CHANGED}[$count] = "warnings: $warn"; - $hash->{CHANGED}[$count+1] = "T: " . $temp . $alarm; + $hash->{CHANGED}[$count+1] = "T: " . $temp . " " . "A: " . $alarm; $hash->{STATE} = "T: " . $temp . " " . "L: " . $hash->{READINGS}{templow}{VAL} . " " . "H: " . $hash->{READINGS}{temphigh}{VAL} . " " . - $alarm; + "A: " . $alarm; } else { $value = OW::get("/uncached/$path/".$a); foreach my $r (sort keys %gets) { @@ -226,17 +226,13 @@ OWTEMP_Set($@) if ($key eq "INTERVAL" || $key eq "ALARMINT") { $hash->{$key} = $value; - #RemoveInternalTimer($hash); - if ($hash->{ALARM} == 0) { - InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWTEMP_GetUpdate", $hash, 0); - } else { - InternalTimer(gettimeofday()+$hash->{ALARMINT}, "OWTEMP_GetUpdate", $hash, 0); - } - Log 4, "OWTEMP $hash->{NAME} $key $value"; + RemoveInternalTimer($hash); + InternalTimer(gettimeofday()+$hash->{$key}, "OWTEMP_GetUpdate", $hash, 0); + Log 4, "set OWTEMP $hash->{NAME} $key $value"; } elsif ($key eq "templow" || $key eq "temphigh") { return "wrong value: range -55°C - 125°C" if (int($value) < -55 || int($value) > 125); $ret = OW::put("$path/".$key,$value); - Log 4, "OWTEMP $hash->{NAME} $key $value"; + Log 4, "set OWTEMP $hash->{NAME} $key $value"; $hash->{LOCAL} = 1; OWTEMP_GetUpdate($hash,$key); delete $hash->{LOCAL}; @@ -245,7 +241,7 @@ OWTEMP_Set($@) $hash->{LOCAL} = 1; $value = OWTEMP_GetUpdate($hash,$key); delete $hash->{LOCAL}; - Log 4, "OWTEMP $hash->{NAME} $key $value"; + Log 4, "set OWTEMP $hash->{NAME} $key $value"; } return undef; }