mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
fixed: some minor bugs
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@3675 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1b6f0d150f
commit
d3e24e28b3
@ -37,7 +37,7 @@ use List::MoreUtils 'first_index';
|
|||||||
use XML::Simple;
|
use XML::Simple;
|
||||||
use HttpUtils;
|
use HttpUtils;
|
||||||
require LWP::UserAgent;
|
require LWP::UserAgent;
|
||||||
use Data::Dumper;
|
#use Data::Dumper;
|
||||||
|
|
||||||
sub GDS_Define($$$);
|
sub GDS_Define($$$);
|
||||||
sub GDS_Undef($$);
|
sub GDS_Undef($$);
|
||||||
@ -624,7 +624,7 @@ sub retrieveConditions($$@){
|
|||||||
|
|
||||||
Log3($name, 3, "GDS $name: Retrieving conditions data");
|
Log3($name, 3, "GDS $name: Retrieving conditions data");
|
||||||
|
|
||||||
($dataFile, $found) = retrieveFile($hash,"conditions");
|
($dataFile, $found) = retrieveFile($hash,"conditions",undef,undef,1);
|
||||||
open WXDATA, $tempDir.$name."_conditions";
|
open WXDATA, $tempDir.$name."_conditions";
|
||||||
while (chomp($line = <WXDATA>)) {
|
while (chomp($line = <WXDATA>)) {
|
||||||
map {s/\r//g;} ($line);
|
map {s/\r//g;} ($line);
|
||||||
@ -745,6 +745,7 @@ sub retrieveFile($$;$$$){
|
|||||||
}
|
}
|
||||||
|
|
||||||
when("conditions"){
|
when("conditions"){
|
||||||
|
$useFtp = 1;
|
||||||
$dir = "gds/specials/observations/tables/germany/";
|
$dir = "gds/specials/observations/tables/germany/";
|
||||||
$dwd = "*";
|
$dwd = "*";
|
||||||
$targetFile = $tempDir.$name."_".$request;
|
$targetFile = $tempDir.$name."_".$request;
|
||||||
@ -752,6 +753,7 @@ sub retrieveFile($$;$$$){
|
|||||||
}
|
}
|
||||||
|
|
||||||
when("warnings"){
|
when("warnings"){
|
||||||
|
$useFtp = 1;
|
||||||
if(length($parameter) != 2){
|
if(length($parameter) != 2){
|
||||||
$parameter = $bula2bulaShort{lc($parameter)};
|
$parameter = $bula2bulaShort{lc($parameter)};
|
||||||
}
|
}
|
||||||
@ -785,8 +787,10 @@ sub retrieveFile($$;$$$){
|
|||||||
$urlString .= $dataFile;
|
$urlString .= $dataFile;
|
||||||
Log3($name, 3, "GDS $name: retrieving $dataFile");
|
Log3($name, 3, "GDS $name: retrieving $dataFile");
|
||||||
if($useFtp){
|
if($useFtp){
|
||||||
|
Log3($name, 3, "GDS $name: using FTP for retrieval");
|
||||||
$ftp->get($files[-1], $targetFile);
|
$ftp->get($files[-1], $targetFile);
|
||||||
} else {
|
} else {
|
||||||
|
Log3($name, 3, "GDS $name: using HTTP for retrieval");
|
||||||
$ua->get($urlString,':content_file' => $targetFile);
|
$ua->get($urlString,':content_file' => $targetFile);
|
||||||
}
|
}
|
||||||
$found = 1;
|
$found = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user