mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
76_SMAPortal: contrib 3.6.2
git-svn-id: https://svn.fhem.de/fhem/trunk@23092 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
0dc50648c0
commit
ccd0e9a01f
@ -1957,11 +1957,9 @@ sub __dispatchPost {
|
||||
call => $call,
|
||||
tag => $tag,
|
||||
fields => $fields,
|
||||
content => $cont,
|
||||
content => $cont
|
||||
});
|
||||
|
||||
$ua->cookie_jar->extract_cookies($data);
|
||||
|
||||
($reread,$retry,$errstate,$state) = ___analyzeData ({ name => $name,
|
||||
ua => $ua,
|
||||
errstate => $errstate,
|
||||
@ -2090,6 +2088,11 @@ sub ___analyzeData { ## no critic 'complexity'
|
||||
my $em2e = qq{The current data cannot be retrieved from the PV system. Check the cabling and configuration};
|
||||
my $em2d = qq{Die aktuellen Daten .*? nicht von der Anlage abgerufen werden.*? Sie die Verkabelung und Konfiguration};
|
||||
|
||||
___extractCookie ({ ua => $ua,
|
||||
data => $ad,
|
||||
name => $name,
|
||||
});
|
||||
|
||||
$data = eval{decode_json($ad_content)} or do { $data = $ad_content };
|
||||
|
||||
my $jsonerror = $ad->header('Jsonerror') // ""; # Portal meldet keine Verarbeitung des Reaquests möglich (z.B. Jahr 0000 zur Auswertung angefordert)
|
||||
@ -2164,6 +2167,22 @@ sub ___analyzeData { ## no critic 'complexity'
|
||||
return ($reread,$retry,$errstate,$state);
|
||||
}
|
||||
|
||||
################################################################
|
||||
# Cookie Daten analysieren & extrahieren
|
||||
# Die extract_cookies()-Methode sucht im HTTP::Response-Objekt,
|
||||
# das als Argument übergeben wird, nach Set-Cookie: und
|
||||
# Set-Cookie2: Headern.
|
||||
################################################################
|
||||
sub ___extractCookie {
|
||||
my $paref = shift;
|
||||
my $ua = $paref->{ua};
|
||||
my $data = $paref->{data}; # empfangene Rohdaten
|
||||
|
||||
eval { $ua->cookie_jar->extract_cookies($data) };
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
################################################################
|
||||
## Verarbeitung empfangene Daten, setzen Readings
|
||||
################################################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user