devel #49

Merged
marko merged 14 commits from devel into master 2022-02-09 13:16:38 +00:00
2 changed files with 23 additions and 16 deletions
Showing only changes of commit bd06f26248 - Show all commits

View File

@ -62,7 +62,7 @@ use warnings;
use POSIX;
use FHEM::Meta;
#use Data::Dumper;
use Data::Dumper;
use HttpUtils;
@ -923,21 +923,28 @@ qq{GardenaSmartBridge ($name) - got result from asynchronous parsing}
CleanSubprocess($hash);
for my $json ( @{$response} ) {
if ( ref( @{$response} ) eq 'ARRAY' ) {
for my $json ( @{$response} ) {
#################
$decode_json = eval { decode_json($json) };
if ($@) {
Log3 $name, 5,
#################
$decode_json = eval { decode_json($json) };
if ($@) {
Log3 $name, 5,
"GardenaSmartBridge ($name) - JSON error while request: $@";
}
}
Dispatch( $hash, $json, undef )
if ( $decode_json->{category} ne 'gateway' );
WriteReadings( $hash, $decode_json )
if ( defined( $decode_json->{category} )
&& $decode_json->{category} eq 'gateway' );
Dispatch( $hash, $json, undef )
if ( $decode_json->{category} ne 'gateway' );
WriteReadings( $hash, $decode_json )
if ( defined( $decode_json->{category} )
&& $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 {
my $subprocess = shift;
my $buffer = $subprocess->{buffer};
my $response = [];
my @response = ();
my ( $json, $tail ) = ParseJSON($buffer);
while ($json) {
if ( defined($tail) and $tail ) {
push @{$response}, $json;
push @response, $json;
}
( $json, $tail ) = ParseJSON($tail);
}
$subprocess->writeToParent($response);
$subprocess->writeToParent( \@response );
return;
}

View File

@ -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