mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
70_Pushbullet.pm: improved logging
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@8033 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e9ff664de7
commit
b55bcae9ca
@ -424,13 +424,15 @@ sub Pushbullet_getDeviceIden($$){
|
|||||||
|
|
||||||
while( ($nkey, $nvalue) = each%{$hash->{READINGS}} ){
|
while( ($nkey, $nvalue) = each%{$hash->{READINGS}} ){
|
||||||
while( ($rkey, $rvalue) = each%{$hash->{READINGS}{$nkey}} ){
|
while( ($rkey, $rvalue) = each%{$hash->{READINGS}{$nkey}} ){
|
||||||
Log3 $hash, 4, $name . ": nkey:" . $nkey . " nvalue:" . $nvalue . " rkey:" . $rkey . " rvalue:" . $rvalue if( $rvalue eq $deviceNick );
|
Log3 $hash, 5, $name . ": nkey:" . $nkey . " nvalue:" . $nvalue . " rkey:" . $rkey . " rvalue:" . $rvalue if( $rvalue eq $deviceNick );
|
||||||
$deviceIden = $nkey if( $rvalue eq $deviceNick );
|
$deviceIden = $nkey if( $rvalue eq $deviceNick );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log3 $hash, 3, "$name: deviceIden konnte nicht eingelesen werden." if( !$deviceIden );
|
if( !$deviceIden ){
|
||||||
return if( !defined($deviceIden) );
|
Log3 $hash, 3, "$name: Can not read deviceIden from $deviceNick.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
@deviceIdenSplit = split( /_name/, $deviceIden );
|
@deviceIdenSplit = split( /_name/, $deviceIden );
|
||||||
$deviceIden = $deviceIdenSplit[0];
|
$deviceIden = $deviceIdenSplit[0];
|
||||||
@ -445,8 +447,6 @@ sub Pushbullet_httpCall($$$$){
|
|||||||
my ($json,$err,$data,$decoded);
|
my ($json,$err,$data,$decoded);
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
Log3 $hash, 5,"HASH: " . Dumper($jsonHash);
|
|
||||||
|
|
||||||
$json = JSON->new->latin1->encode($jsonHash) if( $jsonHash );
|
$json = JSON->new->latin1->encode($jsonHash) if( $jsonHash );
|
||||||
|
|
||||||
($err,$data) = HttpUtils_BlockingGet({
|
($err,$data) = HttpUtils_BlockingGet({
|
||||||
@ -455,15 +455,15 @@ sub Pushbullet_httpCall($$$$){
|
|||||||
header => "Content-Type: application/json",
|
header => "Content-Type: application/json",
|
||||||
data => $json
|
data => $json
|
||||||
});
|
});
|
||||||
Log3 $hash, 4, "JSON -> Pushbullet:" . Dumper($json);
|
|
||||||
Log3 $hash, 4, "Pushbullet -> FHEM: " . Dumper($data);
|
|
||||||
|
|
||||||
|
$json = "" if( !$json );
|
||||||
$data = "" if( !$data );
|
$data = "" if( !$data );
|
||||||
|
|
||||||
|
Log3 $hash, 4, "FHEM -> Pushbullet.com: " . $json;
|
||||||
|
Log3 $hash, 4, "Pushbullet.com -> FHEM: " . $data;
|
||||||
|
|
||||||
Log3 $hash, 5, '$err: ' . $err;
|
Log3 $hash, 5, '$err: ' . $err;
|
||||||
Log3 $hash, 5, '$method: ' . $method;
|
Log3 $hash, 5, '$method: ' . $method;
|
||||||
Log3 $hash, 5, '$url: ' . $url;
|
|
||||||
Log3 $hash, 5, '$data: ' . $data;
|
|
||||||
|
|
||||||
Log3 $hash, 3, "Something gone wrong" if( $data =~ "<!DOCTYPE html>" );
|
Log3 $hash, 3, "Something gone wrong" if( $data =~ "<!DOCTYPE html>" );
|
||||||
$err = 1 if( $data =~ "<!DOCTYPE html>" );
|
$err = 1 if( $data =~ "<!DOCTYPE html>" );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user