From 987e389577c051b29ecaf35d5bd6668304c3db11 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 12 Jan 2016 09:02:04 +0100 Subject: [PATCH] =?UTF-8?q?Verbesserte=20Fehlerbehandlung=20was=20den=20St?= =?UTF-8?q?atus=20deviceState=20offline=20an=20geht,=20Fehler=20f=C3=BCr?= =?UTF-8?q?=20dauerabfragen=20trotz=20no=20route=20to=20target=20gefunden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 74_AMAD.pm | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/74_AMAD.pm b/74_AMAD.pm index 4460fda..2b8a9af 100644 --- a/74_AMAD.pm +++ b/74_AMAD.pm @@ -316,11 +316,6 @@ sub AMAD_RetrieveAutomagicInfoFinished($$$) { Log3 $name, 4, "AMAD ($name) - Informations Flow on your Device is inactive, will try to reactivate"; } - elsif($hash->{helper}{infoErrorCounter} > 4 && ReadingsVal( $name, "flow_Informations", "active" ) eq "active" ){ - readingsBulkUpdate( $hash, "lastStatusRequestError", "check automagicApp on your device" ); - - Log3 $name, 4, "AMAD ($name) - Please check the AutomagicAPP on your Device"; - } elsif( $hash->{helper}{infoErrorCounter} > 9 ) { readingsBulkUpdate( $hash, "lastStatusRequestError", "to many errors, check your network or device configuration" ); @@ -330,6 +325,12 @@ sub AMAD_RetrieveAutomagicInfoFinished($$$) { readingsBulkUpdate ( $hash, "state", "To many Errors, device set offline"); $hash->{helper}{infoErrorCounter} = 0; } + elsif($hash->{helper}{infoErrorCounter} > 4 && ReadingsVal( $name, "flow_Informations", "active" ) eq "active" ){ + readingsBulkUpdate( $hash, "lastStatusRequestError", "check automagicApp on your device" ); + + Log3 $name, 4, "AMAD ($name) - Please check the AutomagicAPP on your Device"; + } + readingsEndUpdate( $hash, 1 ); } @@ -787,11 +788,6 @@ sub AMAD_HTTP_POSTerrorHandling($$$) { Log3 $name, 4, "AMAD ($name) - Flow SetCommands on your Device is inactive, will try to reactivate"; } - elsif( $hash->{helper}{setCmdErrorCounter} > 4 && ReadingsVal( $name, "flow_SetCommands", "active" ) eq "active" ){ - readingsBulkUpdate( $hash, "lastSetCommandError", "check automagicApp on your device" ); - - Log3 $name, 4, "AMAD ($name) - Please check the AutomagicAPP on your Device"; - } elsif( $hash->{helper}{setCmdErrorCounter} > 9 ) { readingsBulkUpdate( $hash, "lastSetCommandError", "to many errors, check your network or device configuration" ); @@ -801,6 +797,12 @@ sub AMAD_HTTP_POSTerrorHandling($$$) { readingsBulkUpdate( $hash, "state", "To many Errors, device set offline" ); $hash->{helper}{setCmdErrorCounter} = 0; } + elsif( $hash->{helper}{setCmdErrorCounter} > 4 && ReadingsVal( $name, "flow_SetCommands", "active" ) eq "active" ){ + readingsBulkUpdate( $hash, "lastSetCommandError", "check automagicApp on your device" ); + + Log3 $name, 4, "AMAD ($name) - Please check the AutomagicAPP on your Device"; + } + readingsEndUpdate( $hash, 1 ); }