2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

FRITZBOX: debugging improved

git-svn-id: https://svn.fhem.de/fhem/trunk@12163 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
grompo 2016-09-17 08:38:20 +00:00
parent cf0b75fad4
commit d4ddcb757a

View File

@ -1315,6 +1315,7 @@ sub FRITZBOX_Readout_Run_Web($)
$result = FRITZBOX_Web_Query( $hash, $queryStr) ;
# Abbruch wenn Fehler beim Lesen der Fritzbox-Antwort
if (defined $result->{Error}) {
FRITZBOX_Log $hash, 2, "Error: ".$result->{Error};
my $returnStr = "Error|" . $result->{Error};
@ -1322,6 +1323,7 @@ sub FRITZBOX_Readout_Run_Web($)
$returnStr .= "|" . join('|', @roReadings ) if int @roReadings;
return $name."|".encode_base64($returnStr,"");
}
FRITZBOX_Readout_Add_Reading $hash, \@roReadings, "fhem->sid", $result->{sid};
FRITZBOX_Readout_Add_Reading $hash, \@roReadings, "fhem->sidTime", time();
@ -4480,6 +4482,7 @@ sub FRITZBOX_Web_Query($$@)
if ($response->is_error) {
my %retHash = ("Error" => $response->status_line);
FRITZBOX_Log $hash, 5, "Error: ".$response->status_line;
return \%retHash;
}
@ -4500,7 +4503,8 @@ sub FRITZBOX_Web_Query($$@)
my $jsonResult ;
if ($charSet eq "UTF-8") {
$jsonResult = JSON->new->utf8->decode( $jsonText );
} else {
}
else {
$jsonResult = JSON->new->latin1->decode( $jsonText );
}
$jsonResult->{sid} = $sid;