This commit is contained in:
Marko Oldenburg 2019-10-02 12:51:20 +02:00
parent 67178a3aa5
commit 9e984765aa

View File

@ -176,8 +176,8 @@ my %paths = (
'siteinfo' => 'site_info', 'siteinfo' => 'site_info',
'sitename' => 'site_info/site_name', 'sitename' => 'site_info/site_name',
'sitemaster' => 'sitemaster', 'sitemaster' => 'sitemaster',
'powerwallsstop' => 'sitemaster/stop', # 'powerwallsstop' => 'sitemaster/stop',
'powerwallsrun' => 'sitemaster/run', # 'powerwallsrun' => 'sitemaster/run',
'powerwalls' => 'powerwalls', 'powerwalls' => 'powerwalls',
'registration' => 'customer/registration', 'registration' => 'customer/registration',
'status' => 'status', 'status' => 'status',
@ -551,29 +551,29 @@ sub ErrorHandling($$$) {
return; return;
} }
if ( $data =~ /Error/i # if ( $data =~ /Error/i
and exists($param->{code}) # and exists($param->{code})
and $param->{code} != 200 ) # and $param->{code} != 200 )
{ # {
print( 'TESLA DEBUG0 - Path: ' . $param->{setCmd} . "\n" ); # print( 'TESLA DEBUG0 - Path: ' . $param->{setCmd} . "\n" );
print( 'TESLA DEBUG0 - ResponseString: ' . Dumper $data . "\n" ); # print( 'TESLA DEBUG0 - ResponseString: ' . Dumper $data . "\n" );
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};
Log3 $name, 3, # Log3 $name, 3,
"TeslaPowerwall2AC ($name) - statusRequestERROR: data " # "TeslaPowerwall2AC ($name) - statusRequestERROR: data "
. $data; # . $data;
#
$hash->{actionQueue} = []; # $hash->{actionQueue} = [];
return; # return;
} # }
if ( $data =~ m#{"code":(\d+),"error":"(.+)","message":"(.+)"}$# ) { if ( $data =~ m#{"code":(\d+),"error":"(.+)","message":"(.+)"}$# ) {