2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

76_SMAPortal: bug fixes get/switch consumers

git-svn-id: https://svn.fhem.de/fhem/trunk@22153 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-06-10 17:21:30 +00:00
parent 2af566bd6d
commit 30bc9f7064
2 changed files with 10 additions and 8 deletions

View File

@ -718,7 +718,7 @@ sub controlParams {
my $name = shift;
# Voreinstellungen
my $timeout = 290; # Standard Timeout
my $timeoutdef = 290; # Standard Timeout
my $definterval = 300; # Standard Interval
my $buffer = 5; # Sicherheitspuffer zum nächsten Intervall
@ -732,14 +732,15 @@ sub controlParams {
$ctime = 7 if($ctime > 7); # Ausreißer ignorieren
if(!$interval) { # manueller Datenabruf
return ($interval,$maxcycles,$timeout,$ctime);
return ($interval,$maxcycles,$timeoutdef,$ctime);
}
# max Anzahl Zyklen
$maxcycles = int(($interval - $buffer) / $ctime) if($ctime);
# Timeout kalkulieren
$timeout = int(($maxcycles * $ctime) + $proctime - $buffer);
my $timeout = int(($maxcycles * $ctime) + $proctime - $buffer);
$timeout = $timeoutdef if($timeout < 10);
return ($interval,$maxcycles,$timeout,$ctime);
}
@ -1337,7 +1338,7 @@ sub ParseData { ## no critic
$op = ($op eq "auto") ? "off (automatic)" : $op;
readingsBulkUpdate($hash, "L3_${d}_Switch", $op);
}
readingsBulkUpdate($hash, "lastCycleTime", $ctime);
readingsBulkUpdate($hash, "lastCycleTime", $ctime) if($ctime > 0);
readingsBulkUpdate($hash, "summary" , "$sum W");
} else {

View File

@ -718,7 +718,7 @@ sub controlParams {
my $name = shift;
# Voreinstellungen
my $timeout = 290; # Standard Timeout
my $timeoutdef = 290; # Standard Timeout
my $definterval = 300; # Standard Interval
my $buffer = 5; # Sicherheitspuffer zum nächsten Intervall
@ -732,14 +732,15 @@ sub controlParams {
$ctime = 7 if($ctime > 7); # Ausreißer ignorieren
if(!$interval) { # manueller Datenabruf
return ($interval,$maxcycles,$timeout,$ctime);
return ($interval,$maxcycles,$timeoutdef,$ctime);
}
# max Anzahl Zyklen
$maxcycles = int(($interval - $buffer) / $ctime) if($ctime);
# Timeout kalkulieren
$timeout = int(($maxcycles * $ctime) + $proctime - $buffer);
my $timeout = int(($maxcycles * $ctime) + $proctime - $buffer);
$timeout = $timeoutdef if($timeout < 10);
return ($interval,$maxcycles,$timeout,$ctime);
}
@ -1337,7 +1338,7 @@ sub ParseData { ## no critic
$op = ($op eq "auto") ? "off (automatic)" : $op;
readingsBulkUpdate($hash, "L3_${d}_Switch", $op);
}
readingsBulkUpdate($hash, "lastCycleTime", $ctime);
readingsBulkUpdate($hash, "lastCycleTime", $ctime) if($ctime > 0);
readingsBulkUpdate($hash, "summary" , "$sum W");
} else {