diff --git a/fhem/CHANGED b/fhem/CHANGED index fd94a42e0..108bd25b7 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: contrib/98_openweathermap.pm - add support for stationByZip. + e.g. 76133,de will find weather data for Karlsruhe,Germany - bugfix: 38_CO20: fixed error messages on timeout - feature: codemirror modules now loaded by default: search.js, comment.js dialog.js, autorefresh.js, searchcursor.js, dialog.css diff --git a/fhem/contrib/98_openweathermap.pm b/fhem/contrib/98_openweathermap.pm index 9faf75c85..2bf04b540 100644 --- a/fhem/contrib/98_openweathermap.pm +++ b/fhem/contrib/98_openweathermap.pm @@ -118,7 +118,8 @@ sub OWO_Shutdown($) { sub OWO_Set($@){ my ($hash, @a) = @_; my $name = $hash->{NAME}; - my $usage = "Unknown argument, choose one of clear:readings stationById stationByGeo stationByName send:noArg"; + my $usage = "Unknown argument, choose one of clear:readings stationById stationByGeo ". + "stationByName stationByZip send:noArg"; my $response; return "No Argument given" if(!defined($a[1])); @@ -156,6 +157,10 @@ sub OWO_Set($@){ $urlString = $urlString."?id=".$a[2]; } + when("stationByZip"){ + $urlString = $urlString."?zip=".$a[2]; + } + when("stationByGeo"){ $a[2] = AttrVal("global", "latitude", 0) unless(defined($a[2])); $a[3] = AttrVal("global", "longitude", 0) unless(defined($a[3])); @@ -174,7 +179,7 @@ sub OWO_Set($@){ sub OWO_Get($@){ my ($hash, @a) = @_; my $name = $hash->{NAME}; - my $usage = "Unknown argument, choose one of stationById stationByGeo stationByName"; + my $usage = "Unknown argument, choose one of stationById stationByGeo stationByName stationByZip"; my $response; return "No Argument given" if(!defined($a[1])); @@ -200,6 +205,10 @@ sub OWO_Get($@){ $urlString = $urlString."?id=".$a[2]; } + when("stationByZip"){ + $urlString = $urlString."?zip=".$a[2]; + } + when("stationByGeo"){ $a[2] = AttrVal("global", "latitude", 0) unless(defined($a[2])); $a[3] = AttrVal("global", "longitude", 0) unless(defined($a[3]));