mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-25 03:39:21 +00:00
PRESENCE: show error message in case of aborted BlockingCall (Forum: #76002)
git-svn-id: https://svn.fhem.de/fhem/trunk@15194 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
acb029da43
commit
4b3dc4ad84
@ -1140,7 +1140,7 @@ sub PRESENCE_ProcessLocalScan($)
|
|||||||
sub PRESENCE_ProcessAbortedScan($)
|
sub PRESENCE_ProcessAbortedScan($)
|
||||||
{
|
{
|
||||||
|
|
||||||
my ($hash) = @_;
|
my ($hash, $msg) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
delete($hash->{helper}{RUNNING_PID});
|
delete($hash->{helper}{RUNNING_PID});
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
@ -1149,13 +1149,13 @@ sub PRESENCE_ProcessAbortedScan($)
|
|||||||
{
|
{
|
||||||
if($hash->{helper}{RETRY_COUNT} >= 3)
|
if($hash->{helper}{RETRY_COUNT} >= 3)
|
||||||
{
|
{
|
||||||
Log3 $hash->{NAME}, 2, "PRESENCE ($name) - device could not be checked after ".$hash->{helper}{RETRY_COUNT}." ".($hash->{helper}{RETRY_COUNT} > 1 ? "retries" : "retry"). " (resuming normal operation)" if($hash->{helper}{RETRY_COUNT} == 3);
|
Log3 $hash->{NAME}, 2, "PRESENCE ($name) - device could not be checked after ".$hash->{helper}{RETRY_COUNT}." ".($hash->{helper}{RETRY_COUNT} > 1 ? "retries" : "retry"). " (resuming normal operation): $msg" if($hash->{helper}{RETRY_COUNT} == 3);
|
||||||
InternalTimer(gettimeofday()+10, "PRESENCE_StartLocalScan", $hash, 0) unless($hash->{helper}{DISABLED});
|
InternalTimer(gettimeofday()+10, "PRESENCE_StartLocalScan", $hash, 0) unless($hash->{helper}{DISABLED});
|
||||||
$hash->{helper}{RETRY_COUNT}++;
|
$hash->{helper}{RETRY_COUNT}++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log3 $hash->{NAME}, 2, "PRESENCE ($name) - device could not be checked after ".$hash->{helper}{RETRY_COUNT}." ".($hash->{helper}{RETRY_COUNT} > 1 ? "retries" : "retry")." (retrying in 10 seconds)";
|
Log3 $hash->{NAME}, 2, "PRESENCE ($name) - device could not be checked after ".$hash->{helper}{RETRY_COUNT}." ".($hash->{helper}{RETRY_COUNT} > 1 ? "retries" : "retry")." (retrying in 10 seconds): $msg";
|
||||||
InternalTimer(gettimeofday()+10, "PRESENCE_StartLocalScan", $hash, 0) unless($hash->{helper}{DISABLED});
|
InternalTimer(gettimeofday()+10, "PRESENCE_StartLocalScan", $hash, 0) unless($hash->{helper}{DISABLED});
|
||||||
$hash->{helper}{RETRY_COUNT}++;
|
$hash->{helper}{RETRY_COUNT}++;
|
||||||
}
|
}
|
||||||
@ -1164,7 +1164,7 @@ sub PRESENCE_ProcessAbortedScan($)
|
|||||||
{
|
{
|
||||||
$hash->{helper}{RETRY_COUNT} = 1;
|
$hash->{helper}{RETRY_COUNT} = 1;
|
||||||
InternalTimer(gettimeofday()+10, "PRESENCE_StartLocalScan", $hash, 0) unless($hash->{helper}{DISABLED});
|
InternalTimer(gettimeofday()+10, "PRESENCE_StartLocalScan", $hash, 0) unless($hash->{helper}{DISABLED});
|
||||||
Log3 $hash->{NAME}, 2, "PRESENCE ($name) - device could not be checked (retrying in 10 seconds)"
|
Log3 $hash->{NAME}, 2, "PRESENCE ($name) - device could not be checked (retrying in 10 seconds): $msg"
|
||||||
}
|
}
|
||||||
|
|
||||||
readingsSingleUpdate($hash, "state", "timeout",1);
|
readingsSingleUpdate($hash, "state", "timeout",1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user