mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-07 23:09:26 +00:00
55_GDS.pm: fixed empty stations list
git-svn-id: https://svn.fhem.de/fhem/trunk@10176 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a2862bf6d7
commit
69366a0ec5
@ -42,8 +42,6 @@ use Archive::Extract;
|
||||
use Net::FTP;
|
||||
use XML::Simple;
|
||||
|
||||
use Data::Dumper;
|
||||
|
||||
eval "use GDSweblink";
|
||||
|
||||
no if $] >= 5.017011, warnings => 'experimental';
|
||||
@ -301,7 +299,7 @@ sub GDS_Define($$$) {
|
||||
Log3($name, 4, "GDS $name: tempDir=".$tempDir);
|
||||
|
||||
_GDS_addExtension("GDS_CGI","gds","GDS Files");
|
||||
|
||||
retrieveData($hash,'conditions');
|
||||
readingsSingleUpdate($hash, 'state', 'active',1);
|
||||
|
||||
return undef;
|
||||
@ -419,7 +417,6 @@ sub GDS_Get($@) {
|
||||
"conditionsmap:".$cmapList." ".
|
||||
"forecasts:".$fcList." ".
|
||||
"forecastsmap:".$fmapList." ".
|
||||
"headlines ".
|
||||
"radarmap:".$cmapList." ".
|
||||
"warningsmap:"."Deutschland,Bodensee,".$bulaList." ".
|
||||
"warnings:".$bulaList;
|
||||
@ -457,12 +454,6 @@ sub GDS_Get($@) {
|
||||
break;
|
||||
}
|
||||
|
||||
when("headlines"){
|
||||
return "Error: Alerts disabled by attribute." unless AttrVal($name,'gdsUseAlerts',0);
|
||||
$parameter //= "|";
|
||||
return gdsAlertsHeadlines($name,$parameter);
|
||||
}
|
||||
|
||||
when("warningsmap"){
|
||||
# retrieve map: warnings
|
||||
if(length($parameter) != 2){
|
||||
@ -533,6 +524,12 @@ sub GDS_Get($@) {
|
||||
break;
|
||||
}
|
||||
|
||||
when("headlines"){
|
||||
return "Error: Alerts disabled by attribute." unless AttrVal($name,'gdsUseAlerts',0);
|
||||
$result = gdsHeadlines($name);
|
||||
break;
|
||||
}
|
||||
|
||||
when("conditions"){
|
||||
getConditions($hash, "g", @a);
|
||||
break;
|
||||
@ -807,7 +804,7 @@ sub __GDS_HTMLTail {
|
||||
#
|
||||
# Tools
|
||||
|
||||
sub gdsAlertsHeadlines($;$) {
|
||||
sub gdsHeadlines($;$) {
|
||||
my ($d,$sep) = @_;
|
||||
my $text = "";
|
||||
$sep = (defined($sep)) ? $sep : '|';
|
||||
@ -819,12 +816,6 @@ sub gdsAlertsHeadlines($;$) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
sub gdsHeadlines($;$) {
|
||||
my $text = "GDS error: gdsHeadlines() is deprecated. Please use gdsAlertsHeadlines()";
|
||||
Log 1, $text;
|
||||
return $text;
|
||||
}
|
||||
|
||||
sub setHelp(){
|
||||
return "Use one of the following commands:\n".
|
||||
sepLine(35)."\n".
|
||||
@ -1318,6 +1309,7 @@ sub _finishedCONDITIONS {
|
||||
|
||||
$hash->{GDS_CONDITIONS_READ} = int(time());
|
||||
my $cf = AttrVal($name,'gdsSetCond',0);
|
||||
return unless $cf;
|
||||
# GDS_GetUpdate($hash,1) if $cf;
|
||||
my @b;
|
||||
push @b, undef;
|
||||
@ -1885,7 +1877,6 @@ sub getListForecastStations($) {
|
||||
|
||||
eval {
|
||||
foreach my $region (@regions) {
|
||||
$data = "";
|
||||
my $areaAndTime = 'Daten_'.$region.'_morgen_spaet';
|
||||
while(($k, $v) = each %allForecastData){
|
||||
if ($k eq $areaAndTime) {
|
||||
@ -1926,8 +1917,7 @@ sub getListForecastStations($) {
|
||||
#
|
||||
###################################################################################################
|
||||
#
|
||||
# 2015-11-26 fixed wrong region handling
|
||||
# added gdsAlertsHeadlines()
|
||||
# 2015-12-14 fixed empty stations list #45633
|
||||
#
|
||||
# 2015-11-17 changed decodeCAPData - fix wrong cumulation (first try)
|
||||
# fixed minor bugs
|
||||
@ -2130,7 +2120,7 @@ sub getListForecastStations($) {
|
||||
|
||||
<br/>
|
||||
Module uses following additional Perl modules:<br/><br/>
|
||||
<code>Net::FTP, XML::Simple, Archive::Extract</code><br/><br/>
|
||||
<code>Net::FTP, XML::Simple</code><br/><br/>
|
||||
If not already installed in your environment,
|
||||
please install them using appropriate commands from your environment.
|
||||
|
||||
@ -2209,25 +2199,24 @@ sub getListForecastStations($) {
|
||||
<ul>Retrieve current conditions at selected station</ul>
|
||||
<br/>
|
||||
|
||||
<code>get <name> conditionsmap <region></code>
|
||||
<br/><br/>
|
||||
<ul>Retrieve map (imagefile) showing current conditions at selected station</ul>
|
||||
<br/>
|
||||
|
||||
<code>get <name> forecasts <region></code>
|
||||
<br/><br/>
|
||||
<ul>Retrieve forecasts for today and the following 3 days for selected region as text</ul>
|
||||
<br/>
|
||||
|
||||
<code>get <name> conditionsmap <region></code>
|
||||
<br/><br/>
|
||||
<ul>Retrieve map (imagefile) showing current conditions at selected station</ul>
|
||||
<br/>
|
||||
|
||||
<code>get <name> forecastsmap <stationName></code>
|
||||
<br/><br/>
|
||||
<ul>Retrieve map (imagefile) showing forecasts for selected region</ul>
|
||||
<br/>
|
||||
|
||||
<code>get <name> headlines [separator]</code>
|
||||
<code>get <name> headlines</code>
|
||||
<br/><br/>
|
||||
<ul>Returns a string, containing all alert headlines. <br/>
|
||||
Default separator is | but can be overriden.</ul>
|
||||
<ul>Returns a string, containing all alert headlines separated by |</ul>
|
||||
<br/>
|
||||
|
||||
<code>get <name> help</code>
|
||||
@ -2337,7 +2326,7 @@ sub getListForecastStations($) {
|
||||
<ul>
|
||||
|
||||
<li>Module uses following additional Perl modules:<br/><br/>
|
||||
<code>Net::FTP, XML::Simple, Archive::Extract</code><br/><br/>
|
||||
<code>Net::FTP, XML::Simple</code><br/><br/>
|
||||
If not already installed in your environment, please install them using appropriate commands from your environment.</li>
|
||||
<br/><br/>
|
||||
<li>Have fun!</li><br/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user