mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
fixed: some minor bugs
modified: commandref added: support for Windows based fhem-installtions git-svn-id: https://svn.fhem.de/fhem/trunk@3683 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7a86ab89e6
commit
f58857994d
@ -73,6 +73,8 @@ sub GDS_Initialize($) {
|
|||||||
"gdsAll:0,1 gdsDebug:0,1 gdsLong:0,1 gdsPolygon:0,1 ".
|
"gdsAll:0,1 gdsDebug:0,1 gdsLong:0,1 gdsPolygon:0,1 ".
|
||||||
$readingFnAttributes;
|
$readingFnAttributes;
|
||||||
|
|
||||||
|
$tempDir = "c:\\temp\\" if($^O eq "MSWin32");
|
||||||
|
|
||||||
fillMappingTables($hash);
|
fillMappingTables($hash);
|
||||||
initDropdownLists($hash);
|
initDropdownLists($hash);
|
||||||
createIndexFile($hash);
|
createIndexFile($hash);
|
||||||
@ -107,12 +109,12 @@ sub GDS_Define($$$) {
|
|||||||
$hash->{helper}{URL} = "ftp-outgoing2.dwd.de";
|
$hash->{helper}{URL} = "ftp-outgoing2.dwd.de";
|
||||||
$hash->{helper}{INTERVAL} = 3600;
|
$hash->{helper}{INTERVAL} = 3600;
|
||||||
|
|
||||||
Log3($name, 3, "GDS $name created");
|
Log3($name, 3, "GDS $name: created");
|
||||||
|
Log3($name, 3, "GDS $name: tempDir=".$tempDir);
|
||||||
|
|
||||||
$dummy = "gds_web_".$name;
|
$dummy = "gds_web_".$name;
|
||||||
CommandDefine(undef, $dummy." HTTPSRV ".$name." ".$tempDir." GDS ".$name." Files");
|
CommandDefine(undef, $dummy." HTTPSRV ".$name." ".$tempDir." GDS ".$name." Files");
|
||||||
$attr{$dummy}{"directoryindex"} = $name.".html";
|
$attr{$dummy}{"directoryindex"} = $name.".html";
|
||||||
|
|
||||||
fillMappingTables($hash);
|
fillMappingTables($hash);
|
||||||
initDropdownLists($hash);
|
initDropdownLists($hash);
|
||||||
createIndexFile($hash);
|
createIndexFile($hash);
|
||||||
@ -282,14 +284,9 @@ sub GDS_Get($@) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
when("rereadcfg"){
|
when("rereadcfg"){
|
||||||
eval {
|
retrieveFile($hash,"conditions");
|
||||||
retrieveFile($hash,"conditions");
|
retrieveFile($hash,"alerts");
|
||||||
$sList = getListStationsDropdown($hash);
|
initDropdownLists($hash);
|
||||||
};
|
|
||||||
eval {
|
|
||||||
retrieveFile($hash,"alerts");
|
|
||||||
($aList, undef) = buildCAPList($hash);
|
|
||||||
};
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -571,7 +568,8 @@ sub decodeCAPData($$){
|
|||||||
|
|
||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
readingsBulkUpdate($hash, "_copyright", "Quelle: Deutscher Wetterdienst");
|
readingsBulkUpdate($hash, "_copyright", "Quelle: Deutscher Wetterdienst");
|
||||||
while(($k, $v) = each %readings) { readingsBulkUpdate($hash, $k, latin1ToUtf8($v)); }
|
while(($k, $v) = each %readings){
|
||||||
|
readingsBulkUpdate($hash, $k, latin1ToUtf8($v)) if(defined($v)); }
|
||||||
readingsEndUpdate($hash, 1);
|
readingsEndUpdate($hash, 1);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -605,7 +603,8 @@ sub retrieveTextWarn($){
|
|||||||
|
|
||||||
my ($line, @a);
|
my ($line, @a);
|
||||||
open WXDATA, $tempDir.$name."_warnings";
|
open WXDATA, $tempDir.$name."_warnings";
|
||||||
while (chomp($line = <WXDATA>)) { push @a, latin1ToUtf8($line); }
|
while (chomp($line = <WXDATA>)) {
|
||||||
|
push @a, latin1ToUtf8($line); }
|
||||||
close WXDATA;
|
close WXDATA;
|
||||||
return join("", @a);
|
return join("", @a);
|
||||||
}
|
}
|
||||||
@ -669,7 +668,8 @@ sub retrieveConditions($$@){
|
|||||||
|
|
||||||
CommandDeleteReading(undef, "$name $prefix"."_.*");
|
CommandDeleteReading(undef, "$name $prefix"."_.*");
|
||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
while(($k, $v) = each %cread) { readingsBulkUpdate($hash, $k, latin1ToUtf8($v)); }
|
while(($k, $v) = each %cread) {
|
||||||
|
readingsBulkUpdate($hash, $k, latin1ToUtf8($v)) if(defined($v)); }
|
||||||
readingsEndUpdate($hash, 1);
|
readingsEndUpdate($hash, 1);
|
||||||
|
|
||||||
$hash->{STATE} = "active";
|
$hash->{STATE} = "active";
|
||||||
@ -1015,18 +1015,24 @@ sub initDropdownLists($){
|
|||||||
my($hash) = @_;
|
my($hash) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
if ($name && -e $tempDir.$name."_conditions"){
|
if ($name){
|
||||||
$sList = getListStationsDropdown($hash);
|
if(-e $tempDir.$name."_conditions"){
|
||||||
} else {
|
$sList = getListStationsDropdown($hash);
|
||||||
$sList = "please_use_rereadcfg_first";
|
} else {
|
||||||
}
|
Log3($name, 3, "GDS $name: no datafile (conditions) found");
|
||||||
|
$sList = "please_use_rereadcfg_first";
|
||||||
|
}
|
||||||
|
|
||||||
if ($name && -e $tempDir.$name."_alerts"){
|
if (-e $tempDir.$name."_alerts"){
|
||||||
($aList, undef) = buildCAPList($hash);
|
($aList, undef) = buildCAPList($hash);
|
||||||
|
} else {
|
||||||
|
Log3($name, 3, "GDS $name: no datafile (alerts) found");
|
||||||
|
$aList = "please_use_rereadcfg_first";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$aList = "please_use_rereadcfg_first";
|
$aList = "please_use_rereadcfg_first";
|
||||||
|
$sList = $aList;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1067,6 +1073,9 @@ sub initDropdownLists($){
|
|||||||
# use parameter #5 = 1 in RetrieveFile for ftp
|
# use parameter #5 = 1 in RetrieveFile for ftp
|
||||||
# added get <name> caplist
|
# added get <name> caplist
|
||||||
#
|
#
|
||||||
|
# 2013-08-13 fixed some minor bugs to prevent annoying console messages
|
||||||
|
# added support for fhem installtions running on windows-based systems
|
||||||
|
#
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
#
|
#
|
||||||
# Further informations
|
# Further informations
|
||||||
@ -1098,6 +1107,18 @@ sub initDropdownLists($){
|
|||||||
<a name="GDS"></a>
|
<a name="GDS"></a>
|
||||||
<h3>GDS</h3>
|
<h3>GDS</h3>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
|
<b>Prerequesits</b>
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
Module uses following additional Perl modules:<br/><br/>
|
||||||
|
<code>Net::FTP, List::MoreUtils, XML::Simple, Text::CSV</code><br/><br/>
|
||||||
|
If not already installed in your environment, please install them using appropriate commands from your environment.
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<br/><br/>
|
||||||
|
|
||||||
<a name="GDSdefine"></a>
|
<a name="GDSdefine"></a>
|
||||||
<b>Define</b>
|
<b>Define</b>
|
||||||
<ul>
|
<ul>
|
||||||
@ -1248,7 +1269,7 @@ sub initDropdownLists($){
|
|||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
<li>Module uses following additional Perl modules:<br/><br/>
|
<li>Module uses following additional Perl modules:<br/><br/>
|
||||||
<ul>Net::FTP, List::MoreUtils, XML::Simple, Text::CSV</ul><br/><br/>
|
<code>Net::FTP, List::MoreUtils, XML::Simple, Text::CSV</code><br/><br/>
|
||||||
If not already installed in your environment, please install them using appropriate commands from your environment.</li>
|
If not already installed in your environment, please install them using appropriate commands from your environment.</li>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<li>Have fun!</li><br/>
|
<li>Have fun!</li><br/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user