mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
changed: logging optimized
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@3630 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e7a116efed
commit
3957f9e337
@ -207,7 +207,7 @@ sub GDS_Define($$$) {
|
||||
my @a = split("[ \t][ \t]*", $def);
|
||||
|
||||
return "syntax: define <name> GDS <username> <password>" if(int(@a) != 4 );
|
||||
|
||||
my $name = $hash->{NAME};
|
||||
$hash->{helper}{USER} = $a[2];
|
||||
$hash->{helper}{PASS} = $a[3];
|
||||
$hash->{helper}{URL} = "ftp-outgoing2.dwd.de";
|
||||
@ -217,7 +217,7 @@ sub GDS_Define($$$) {
|
||||
$sList = getListStationsDropdown();
|
||||
retrieveFile($hash,"alerts");
|
||||
($aList, undef) = buildCAPList();
|
||||
|
||||
Log 3, "GDS $name created";
|
||||
$hash->{STATE} = "active";
|
||||
|
||||
return undef;
|
||||
@ -509,6 +509,7 @@ sub buildCAPList(){
|
||||
sub decodeCAPData($$){
|
||||
my ($hash, $datensatz) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
my $loglevel = GetLogLevel($name,3);
|
||||
my $info = int($datensatz/100);
|
||||
my $area = $datensatz-$info*100;
|
||||
|
||||
@ -519,6 +520,8 @@ sub decodeCAPData($$){
|
||||
my $_gdsLong = AttrVal($name,"gdsLong", 0);
|
||||
my $_gdsPolygon = AttrVal($name,"gdsPolygon", 0);
|
||||
|
||||
Log $loglevel, "GDS $name: Decoding CAP record #".$datensatz;
|
||||
|
||||
# topLevel informations
|
||||
@dummy = split(/\./, $alertsXml->{identifier});
|
||||
|
||||
@ -628,6 +631,7 @@ sub retrieveTextWarn($@){
|
||||
sub retrieveConditions($$@){
|
||||
my ($hash, $prefix, @a) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
my $loglevel = GetLogLevel($name,3);
|
||||
my $user = $hash->{helper}{USER};
|
||||
my $pass = $hash->{helper}{PASS};
|
||||
(my $myStation = utf8ToLatin1($a[2])) =~ s/_/ /g; # replace underscore in stationName by space
|
||||
@ -637,6 +641,8 @@ sub retrieveConditions($$@){
|
||||
|
||||
$debug = AttrVal($name, "gdsDebug", 0);
|
||||
|
||||
Log $loglevel, "GDS $name: Retrieving conditions data";
|
||||
|
||||
($dataFile, $found) = retrieveFile($hash,"conditions");
|
||||
open WXDATA, "/tmp/conditions";
|
||||
while (chomp($line = <WXDATA>)) {
|
||||
@ -697,6 +703,7 @@ sub retrieveFile($$;$){
|
||||
#
|
||||
my ($hash, $request, $parameter) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
my $loglevel = GetLogLevel($name,3);
|
||||
my $user = $hash->{helper}{USER};
|
||||
my $pass = $hash->{helper}{PASS};
|
||||
my $proxyName = AttrVal($name, "gdsProxyName", "");
|
||||
@ -731,6 +738,8 @@ sub retrieveFile($$;$){
|
||||
}
|
||||
}
|
||||
|
||||
Log $loglevel, "GDS $name: retrieving $dir".$dwd." from DWD server";
|
||||
|
||||
$found = 0;
|
||||
eval {
|
||||
$ftp = Net::FTP->new( "ftp-outgoing2.dwd.de",
|
||||
|
@ -219,7 +219,7 @@ sub
|
||||
OWO_GetStatus($;$){
|
||||
my ($hash, $local) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
my $loglevel = AttrVal($name, "loglevel", 3);
|
||||
my $loglevel = GetLogLevel($name,3);
|
||||
$local = 0 unless(defined($local));
|
||||
|
||||
$attr{$name}{"owoInterval"} = 600 if(AttrVal($name,"owoInterval",0) < 600);
|
||||
@ -335,7 +335,7 @@ sub
|
||||
UpdateReadings($$$){
|
||||
my ($hash, $url, $prefix) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
my $loglevel = AttrVal($name, "loglevel", 3);
|
||||
my $loglevel = GetLogLevel($name,3);
|
||||
my ($jsonWeather, $response);
|
||||
$url .= "&APPID=".AttrVal($name, "owoApiKey", "");
|
||||
# $response = GetFileFromURL("$url");
|
||||
|
Loading…
x
Reference in New Issue
Block a user