mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 04:36:36 +00:00
contrib/98_openweathermap.pm: add support for stationByZip
git-svn-id: https://svn.fhem.de/fhem/trunk@9680 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d5f210687f
commit
42a55b1f0d
@ -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
|
||||
|
@ -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]));
|
||||
|
Loading…
x
Reference in New Issue
Block a user