diff --git a/fhem/FHEM/55_GDS.pm b/fhem/FHEM/55_GDS.pm
index 093d1d9a9..8d81c9043 100644
--- a/fhem/FHEM/55_GDS.pm
+++ b/fhem/FHEM/55_GDS.pm
@@ -42,6 +42,8 @@ use Archive::Extract;
use Net::FTP;
use XML::Simple;
+use Data::Dumper;
+
eval "use GDSweblink";
no if $] >= 5.017011, warnings => 'experimental';
@@ -417,6 +419,7 @@ sub GDS_Get($@) {
"conditionsmap:".$cmapList." ".
"forecasts:".$fcList." ".
"forecastsmap:".$fmapList." ".
+ "headlines ".
"radarmap:".$cmapList." ".
"warningsmap:"."Deutschland,Bodensee,".$bulaList." ".
"warnings:".$bulaList;
@@ -454,6 +457,12 @@ 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){
@@ -524,12 +533,6 @@ 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;
@@ -804,7 +807,7 @@ sub __GDS_HTMLTail {
#
# Tools
-sub gdsHeadlines($;$) {
+sub gdsAlertsHeadlines($;$) {
my ($d,$sep) = @_;
my $text = "";
$sep = (defined($sep)) ? $sep : '|';
@@ -816,6 +819,12 @@ sub gdsHeadlines($;$) {
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".
@@ -959,7 +968,7 @@ sub getConditions($$@){
sub _readItem {
my ($line, $pos, $align, $item) = @_;
my $x;
- Debug $line unless $align;
+
if ($align eq "l") {
$x = substr($line, $pos);
$x =~ s/ .+$//g; # after two spaces => next field
@@ -1309,7 +1318,6 @@ 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;
@@ -1877,6 +1885,7 @@ sub getListForecastStations($) {
eval {
foreach my $region (@regions) {
+ $data = "";
my $areaAndTime = 'Daten_'.$region.'_morgen_spaet';
while(($k, $v) = each %allForecastData){
if ($k eq $areaAndTime) {
@@ -1917,7 +1926,8 @@ sub getListForecastStations($) {
#
###################################################################################################
#
-# 2015-12-14 fixed empty stations list #45633
+# 2015-11-26 fixed wrong region handling
+# added gdsAlertsHeadlines()
#
# 2015-11-17 changed decodeCAPData - fix wrong cumulation (first try)
# fixed minor bugs
@@ -2120,7 +2130,7 @@ sub getListForecastStations($) {
Module uses following additional Perl modules:
- Net::FTP, XML::Simple
+ Net::FTP, XML::Simple, Archive::Extract
If not already installed in your environment,
please install them using appropriate commands from your environment.
@@ -2199,24 +2209,25 @@ sub getListForecastStations($) {
get <name> forecasts <region>
- get <name> conditionsmap <region>
get <name> forecasts <region>
+ get <name> forecastsmap <stationName>
get <name> headlines
+ get <name> headlines [separator]
get <name> help
@@ -2321,6 +2332,7 @@ sub getListForecastStations($) {
Readings will NOT be updated automatically
Net::FTP, XML::Simple
Net::FTP, XML::Simple, Archive::Extract