From 610f60a21121051bb44c818c7219000b0a158e4f Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Mon, 4 Jan 2016 10:17:31 +0100 Subject: [PATCH] =?UTF-8?q?Anpassungen=20bez=C3=BCglich=20ReadingsUpdate?= =?UTF-8?q?=20unterhalb=20der=20SSH=20Schleife?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 74_HOMBOT.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/74_HOMBOT.pm b/74_HOMBOT.pm index b3b77ed..6758657 100644 --- a/74_HOMBOT.pm +++ b/74_HOMBOT.pm @@ -298,8 +298,8 @@ sub HOMBOT_RetrieveHomebotInfoFinished($$$) { ### Begin Error Handling if( $hash->{helper}{requestErrorCounter} > 1 ) { - readingsBeginUpdate( $hash ); - readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); + + readingsSingleUpdate( $hash, "lastStatusRequestState", "statusRequest_error", 1 ); if( $hash->{helper}{requestErrorCounter} > 1 && ReadingsVal( $name, "luigiHttpSrvState", "not running" ) eq "running" ) { @@ -310,6 +310,8 @@ sub HOMBOT_RetrieveHomebotInfoFinished($$$) { Log3 $name, 4, "HOMBOT ($name) - ENDE check ssh Error Schleife"; } + readingsBeginUpdate( $hash ); + if( $hash->{helper}{requestErrorCounter} > 4 && $hash->{helper}{setErrorCounter} > 3 && ReadingsVal( $name, "luigiHttpSrvState", "running" ) eq "running" ) { readingsBulkUpdate( $hash, "lastStatusRequestError", "unknown error, please contact the developer" ); @@ -712,8 +714,8 @@ sub HOMBOT_HTTP_POSTerrorHandling($$$) { ### Begin Error Handling if( $hash->{helper}{setErrorCounter} > 1 ) { - readingsBeginUpdate( $hash ); - readingsBulkUpdate( $hash, "lastSetCommandState", "statusRequest_error" ); + + readingsSingleUpdate( $hash, "lastSetCommandState", "statusRequest_error", 1 ); if( $hash->{helper}{setErrorCounter} > 1 && ReadingsVal( $name, "luigiHttpSrvState", "not running" ) eq "running" ) { @@ -723,6 +725,8 @@ sub HOMBOT_HTTP_POSTerrorHandling($$$) { Log3 $name, 4, "HOMBOT ($name) - ENDE check ssh Error Schleife"; } + + readingsBeginUpdate( $hash ); if( $hash->{helper}{requestErrorCounter} > 4 && $hash->{helper}{setErrorCounter} > 2 && ReadingsVal( $name, "luigiHttpSrvState", "running" ) eq "running" ) { readingsBulkUpdate($hash, "lastSetCommandError", "unknown error, please contact the developer" );