patch-async_run_parseJson #48
@ -62,7 +62,7 @@ use warnings;
|
|||||||
use POSIX;
|
use POSIX;
|
||||||
use FHEM::Meta;
|
use FHEM::Meta;
|
||||||
|
|
||||||
#use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
use HttpUtils;
|
use HttpUtils;
|
||||||
|
|
||||||
@ -923,6 +923,7 @@ qq{GardenaSmartBridge ($name) - got result from asynchronous parsing}
|
|||||||
|
|
||||||
CleanSubprocess($hash);
|
CleanSubprocess($hash);
|
||||||
|
|
||||||
|
if ( ref( @{$response} ) eq 'ARRAY' ) {
|
||||||
for my $json ( @{$response} ) {
|
for my $json ( @{$response} ) {
|
||||||
|
|
||||||
#################
|
#################
|
||||||
@ -939,6 +940,12 @@ qq{GardenaSmartBridge ($name) - got result from asynchronous parsing}
|
|||||||
&& $decode_json->{category} eq 'gateway' );
|
&& $decode_json->{category} eq 'gateway' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log3 $name, 3,
|
||||||
|
"GardenaSmartBridge ($name) - It looks like so is no Array reference at response";
|
||||||
|
Log3 $name, 3,
|
||||||
|
"GardenaSmartBridge ($name) - Response ist: " . Dumper $response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -949,19 +956,19 @@ qq{GardenaSmartBridge ($name) - got result from asynchronous parsing}
|
|||||||
sub ResponseSubprocessing {
|
sub ResponseSubprocessing {
|
||||||
my $subprocess = shift;
|
my $subprocess = shift;
|
||||||
my $buffer = $subprocess->{buffer};
|
my $buffer = $subprocess->{buffer};
|
||||||
my $response = [];
|
my @response = ();
|
||||||
|
|
||||||
my ( $json, $tail ) = ParseJSON($buffer);
|
my ( $json, $tail ) = ParseJSON($buffer);
|
||||||
|
|
||||||
while ($json) {
|
while ($json) {
|
||||||
if ( defined($tail) and $tail ) {
|
if ( defined($tail) and $tail ) {
|
||||||
push @{$response}, $json;
|
push @response, $json;
|
||||||
}
|
}
|
||||||
|
|
||||||
( $json, $tail ) = ParseJSON($tail);
|
( $json, $tail ) = ParseJSON($tail);
|
||||||
}
|
}
|
||||||
|
|
||||||
$subprocess->writeToParent($response);
|
$subprocess->writeToParent( \@response );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
UPD 2022-02-01_09:23:35 49566 FHEM/73_GardenaSmartBridge.pm
|
UPD 2022-02-01_09:54:04 49897 FHEM/73_GardenaSmartBridge.pm
|
||||||
UPD 2022-01-31_19:35:42 56993 FHEM/74_GardenaSmartDevice.pm
|
UPD 2022-01-31_19:35:42 56993 FHEM/74_GardenaSmartDevice.pm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user