mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
38_netatmo: changed weathermap calls to new endpoints
git-svn-id: https://svn.fhem.de/fhem/trunk@17485 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
74925619ca
commit
0714cab33c
@ -1,5 +1,6 @@
|
||||
# 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.
|
||||
- change: 38_netatmo: changed weathermap calls to new endpoints
|
||||
- feature: 5.9 released
|
||||
|
||||
- 2018-10-07 (5.9)
|
||||
|
@ -902,6 +902,7 @@ netatmo_checkConnection($)
|
||||
my $name = $hash->{NAME};
|
||||
|
||||
return undef if($hash->{network} eq "ok");
|
||||
return undef if(!defined($hash->{access_token}));
|
||||
|
||||
Log3 $name, 3, "$name: refreshing connection information";
|
||||
|
||||
@ -1109,7 +1110,8 @@ netatmo_initDevice($)
|
||||
|
||||
if(IsDisabled($name) || !defined($name)) {
|
||||
RemoveInternalTimer($hash);
|
||||
$hash->{STATE} = "Disabled";
|
||||
#$hash->{STATE} = "Disabled";
|
||||
readingsSingleUpdate($hash, "active", "disabled", 1);
|
||||
return undef;
|
||||
}
|
||||
|
||||
@ -1186,7 +1188,8 @@ netatmo_initDevice($)
|
||||
|
||||
if(IsDisabled($name) || !defined($name)) {
|
||||
RemoveInternalTimer($hash);
|
||||
$hash->{STATE} = "Disabled";
|
||||
#$hash->{STATE} = "Disabled";
|
||||
readingsSingleUpdate($hash, "active", "disabled", 1);
|
||||
return undef;
|
||||
}
|
||||
|
||||
@ -1588,19 +1591,19 @@ netatmo_getPublicDevices($$;$$$$)
|
||||
|
||||
if( $blocking ) {
|
||||
my($err,$data) = HttpUtils_BlockingGet({
|
||||
url => "https://".$iohash->{helper}{apiserver}."/api/getpublicdata",
|
||||
url => "https://".$iohash->{helper}{apiserver}."/api/getpublicmeasures",
|
||||
timeout => 10,
|
||||
noshutdown => 1,
|
||||
data => { access_token => $iohash->{access_token}, lat_ne => $lat_ne, lon_ne => $lon_ne, lat_sw => $lat_sw, lon_sw => $lon_sw },
|
||||
data => { access_token => $iohash->{access_token}, lat_ne => $lat_ne, lon_ne => $lon_ne, lat_sw => $lat_sw, lon_sw => $lon_sw, quality => 1, divider => 8, limit => 4, zoom => 10, date_end => 'last' },
|
||||
});
|
||||
|
||||
return netatmo_dispatch( {hash=>$hash,type=>'publicdata'},$err,$data );
|
||||
} else {
|
||||
HttpUtils_NonblockingGet({
|
||||
url => "https://".$iohash->{helper}{apiserver}."/api/getpublicdata",
|
||||
url => "https://".$iohash->{helper}{apiserver}."/api/getpublicmeasures",
|
||||
timeout => 60,
|
||||
noshutdown => 1,
|
||||
data => { access_token => $iohash->{access_token}, lat_ne => $lat_ne, lon_ne => $lon_ne, lat_sw => $lat_sw, lon_sw => $lon_sw, filter => 'true' },
|
||||
data => { access_token => $iohash->{access_token}, lat_ne => $lat_ne, lon_ne => $lon_ne, lat_sw => $lat_sw, lon_sw => $lon_sw, quality => 1, divider => 8, limit => 4, zoom => 10, date_end => 'last' },
|
||||
hash => $hash,
|
||||
type => 'publicdata',
|
||||
callback => \&netatmo_dispatch,
|
||||
@ -2542,7 +2545,8 @@ netatmo_poll($)
|
||||
|
||||
if(IsDisabled($name) || !defined($name)) {
|
||||
RemoveInternalTimer($hash);
|
||||
$hash->{STATE} = "Disabled";
|
||||
#$hash->{STATE} = "Disabled";
|
||||
readingsSingleUpdate($hash, "active", "disabled", 1);
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user