This commit is contained in:
Marko Oldenburg 2019-10-02 08:03:23 +02:00
parent 65f438f914
commit 7ade9497e9

View File

@ -557,22 +557,22 @@ sub ErrorHandling($$$) {
return; return;
} }
if ( ( $data =~ /Error/i ) and exists( $param->{code} ) ) { # if ( ( $data =~ /Error/i ) and exists( $param->{code} ) ) {
#
readingsBeginUpdate($hash); # readingsBeginUpdate($hash);
#
readingsBulkUpdate( $hash, 'state', $param->{code}, 1 ); # readingsBulkUpdate( $hash, 'state', $param->{code}, 1 );
readingsBulkUpdate( $hash, 'lastRequestError', $param->{code}, 1 ); # readingsBulkUpdate( $hash, 'lastRequestError', $param->{code}, 1 );
#
readingsEndUpdate( $hash, 1 ); # readingsEndUpdate( $hash, 1 );
#
Log3 $name, 3, # Log3 $name, 3,
"TeslaPowerwall2AC ($name) - statusRequestERROR: http error " # "TeslaPowerwall2AC ($name) - statusRequestERROR: http error "
. $param->{code}; # . $param->{code};
#
$hash->{actionQueue} = []; # $hash->{actionQueue} = [];
return; # return;
} # }
if ( $data =~ m#{"code":(\d+),"error":"(.+)","message":"(.+)"}$# ) { if ( $data =~ m#{"code":(\d+),"error":"(.+)","message":"(.+)"}$# ) {