mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +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.
|
# 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.
|
# 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
|
- bugfix: 38_CO20: fixed error messages on timeout
|
||||||
- feature: codemirror modules now loaded by default: search.js, comment.js
|
- feature: codemirror modules now loaded by default: search.js, comment.js
|
||||||
dialog.js, autorefresh.js, searchcursor.js, dialog.css
|
dialog.js, autorefresh.js, searchcursor.js, dialog.css
|
||||||
|
@ -118,7 +118,8 @@ sub OWO_Shutdown($) {
|
|||||||
sub OWO_Set($@){
|
sub OWO_Set($@){
|
||||||
my ($hash, @a) = @_;
|
my ($hash, @a) = @_;
|
||||||
my $name = $hash->{NAME};
|
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;
|
my $response;
|
||||||
|
|
||||||
return "No Argument given" if(!defined($a[1]));
|
return "No Argument given" if(!defined($a[1]));
|
||||||
@ -156,6 +157,10 @@ sub OWO_Set($@){
|
|||||||
$urlString = $urlString."?id=".$a[2];
|
$urlString = $urlString."?id=".$a[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
when("stationByZip"){
|
||||||
|
$urlString = $urlString."?zip=".$a[2];
|
||||||
|
}
|
||||||
|
|
||||||
when("stationByGeo"){
|
when("stationByGeo"){
|
||||||
$a[2] = AttrVal("global", "latitude", 0) unless(defined($a[2]));
|
$a[2] = AttrVal("global", "latitude", 0) unless(defined($a[2]));
|
||||||
$a[3] = AttrVal("global", "longitude", 0) unless(defined($a[3]));
|
$a[3] = AttrVal("global", "longitude", 0) unless(defined($a[3]));
|
||||||
@ -174,7 +179,7 @@ sub OWO_Set($@){
|
|||||||
sub OWO_Get($@){
|
sub OWO_Get($@){
|
||||||
my ($hash, @a) = @_;
|
my ($hash, @a) = @_;
|
||||||
my $name = $hash->{NAME};
|
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;
|
my $response;
|
||||||
|
|
||||||
return "No Argument given" if(!defined($a[1]));
|
return "No Argument given" if(!defined($a[1]));
|
||||||
@ -200,6 +205,10 @@ sub OWO_Get($@){
|
|||||||
$urlString = $urlString."?id=".$a[2];
|
$urlString = $urlString."?id=".$a[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
when("stationByZip"){
|
||||||
|
$urlString = $urlString."?zip=".$a[2];
|
||||||
|
}
|
||||||
|
|
||||||
when("stationByGeo"){
|
when("stationByGeo"){
|
||||||
$a[2] = AttrVal("global", "latitude", 0) unless(defined($a[2]));
|
$a[2] = AttrVal("global", "latitude", 0) unless(defined($a[2]));
|
||||||
$a[3] = AttrVal("global", "longitude", 0) unless(defined($a[3]));
|
$a[3] = AttrVal("global", "longitude", 0) unless(defined($a[3]));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user