mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
21_OWTEMP.pm: bugfixing
git-svn-id: https://svn.fhem.de/fhem/trunk@516 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
3f1631d331
commit
4c113709c2
@ -559,4 +559,5 @@
|
|||||||
- bugfix: 21_OWTEMP.pm missing trigger fo notify/filelog (M.Fischer)
|
- bugfix: 21_OWTEMP.pm missing trigger fo notify/filelog (M.Fischer)
|
||||||
- feature: 99_getstate.pm get state from S555TH now (M.Fischer)
|
- feature: 99_getstate.pm get state from S555TH now (M.Fischer)
|
||||||
- feature: pgm3: automatic support for CUL_WS (S300TH) added (MartinH)
|
- 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)
|
||||||
|
@ -154,23 +154,23 @@ OWTEMP_GetUpdate($$)
|
|||||||
$warn = "templow";
|
$warn = "templow";
|
||||||
$hash->{ALARM} = "1";
|
$hash->{ALARM} = "1";
|
||||||
$ret = OWTEMP_UpdateReading($hash,"warnings",$now,"",$warn);
|
$ret = OWTEMP_UpdateReading($hash,"warnings",$now,"",$warn);
|
||||||
$alarm = "A: ".$hash->{ALARM};
|
$alarm = $hash->{ALARM};
|
||||||
} elsif ($temp >= $hash->{READINGS}{temphigh}{VAL}) {
|
} elsif ($temp >= $hash->{READINGS}{temphigh}{VAL}) {
|
||||||
$warn = "temphigh";
|
$warn = "temphigh";
|
||||||
$hash->{ALARM} = "1";
|
$hash->{ALARM} = "1";
|
||||||
$ret = OWTEMP_UpdateReading($hash,"warnings",$now,"",$warn);
|
$ret = OWTEMP_UpdateReading($hash,"warnings",$now,"",$warn);
|
||||||
$alarm = "A: ".$hash->{ALARM};
|
$alarm = $hash->{ALARM};
|
||||||
} else {
|
} else {
|
||||||
$ret = OWTEMP_UpdateReading($hash,"warnings",$now,"",$warn);
|
$ret = OWTEMP_UpdateReading($hash,"warnings",$now,"",$warn);
|
||||||
$alarm = "A: ".$hash->{ALARM};
|
$alarm = $hash->{ALARM};
|
||||||
}
|
}
|
||||||
$hash->{CHANGED}[$count] = "warnings: $warn";
|
$hash->{CHANGED}[$count] = "warnings: $warn";
|
||||||
$hash->{CHANGED}[$count+1] = "T: " . $temp . $alarm;
|
$hash->{CHANGED}[$count+1] = "T: " . $temp . " " . "A: " . $alarm;
|
||||||
|
|
||||||
$hash->{STATE} = "T: " . $temp . " " .
|
$hash->{STATE} = "T: " . $temp . " " .
|
||||||
"L: " . $hash->{READINGS}{templow}{VAL} . " " .
|
"L: " . $hash->{READINGS}{templow}{VAL} . " " .
|
||||||
"H: " . $hash->{READINGS}{temphigh}{VAL} . " " .
|
"H: " . $hash->{READINGS}{temphigh}{VAL} . " " .
|
||||||
$alarm;
|
"A: " . $alarm;
|
||||||
} else {
|
} else {
|
||||||
$value = OW::get("/uncached/$path/".$a);
|
$value = OW::get("/uncached/$path/".$a);
|
||||||
foreach my $r (sort keys %gets) {
|
foreach my $r (sort keys %gets) {
|
||||||
@ -226,17 +226,13 @@ OWTEMP_Set($@)
|
|||||||
|
|
||||||
if ($key eq "INTERVAL" || $key eq "ALARMINT") {
|
if ($key eq "INTERVAL" || $key eq "ALARMINT") {
|
||||||
$hash->{$key} = $value;
|
$hash->{$key} = $value;
|
||||||
#RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
if ($hash->{ALARM} == 0) {
|
InternalTimer(gettimeofday()+$hash->{$key}, "OWTEMP_GetUpdate", $hash, 0);
|
||||||
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWTEMP_GetUpdate", $hash, 0);
|
Log 4, "set OWTEMP $hash->{NAME} $key $value";
|
||||||
} else {
|
|
||||||
InternalTimer(gettimeofday()+$hash->{ALARMINT}, "OWTEMP_GetUpdate", $hash, 0);
|
|
||||||
}
|
|
||||||
Log 4, "OWTEMP $hash->{NAME} $key $value";
|
|
||||||
} elsif ($key eq "templow" || $key eq "temphigh") {
|
} elsif ($key eq "templow" || $key eq "temphigh") {
|
||||||
return "wrong value: range -55°C - 125°C" if (int($value) < -55 || int($value) > 125);
|
return "wrong value: range -55°C - 125°C" if (int($value) < -55 || int($value) > 125);
|
||||||
$ret = OW::put("$path/".$key,$value);
|
$ret = OW::put("$path/".$key,$value);
|
||||||
Log 4, "OWTEMP $hash->{NAME} $key $value";
|
Log 4, "set OWTEMP $hash->{NAME} $key $value";
|
||||||
$hash->{LOCAL} = 1;
|
$hash->{LOCAL} = 1;
|
||||||
OWTEMP_GetUpdate($hash,$key);
|
OWTEMP_GetUpdate($hash,$key);
|
||||||
delete $hash->{LOCAL};
|
delete $hash->{LOCAL};
|
||||||
@ -245,7 +241,7 @@ OWTEMP_Set($@)
|
|||||||
$hash->{LOCAL} = 1;
|
$hash->{LOCAL} = 1;
|
||||||
$value = OWTEMP_GetUpdate($hash,$key);
|
$value = OWTEMP_GetUpdate($hash,$key);
|
||||||
delete $hash->{LOCAL};
|
delete $hash->{LOCAL};
|
||||||
Log 4, "OWTEMP $hash->{NAME} $key $value";
|
Log 4, "set OWTEMP $hash->{NAME} $key $value";
|
||||||
}
|
}
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user