From 36f92eacf7e9509edb060f015f4d53921b746cc8 Mon Sep 17 00:00:00 2001 From: justme1968 Date: Wed, 16 Jul 2014 18:38:17 +0000 Subject: [PATCH] added nossl attribute git-svn-id: https://svn.fhem.de/fhem/trunk@6265 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/38_netatmo.pm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/38_netatmo.pm b/fhem/FHEM/38_netatmo.pm index 5c78ce470..837255745 100644 --- a/fhem/FHEM/38_netatmo.pm +++ b/fhem/FHEM/38_netatmo.pm @@ -169,8 +169,11 @@ netatmo_getToken($) { my ($hash) = @_; + my $https = "https"; + $https = "http" if( AttrVal($hash->{NAME}, "nossl", 0) ); + my($err,$data) = HttpUtils_BlockingGet({ - url => 'https://api.netatmo.net/oauth2/token', + url => "$https://api.netatmo.net/oauth2/token", timeout => 10, noshutdown => 1, data => {grant_type => 'password', client_id => $hash->{client_id}, client_secret=> $hash->{client_secret}, username => $hash->{username}, password => $hash->{password}}, @@ -192,9 +195,12 @@ netatmo_refreshToken($;$) return undef if( $seconds < $hash->{expires_at} - 300 ); } + my $https = "https"; + $https = "http" if( AttrVal($hash->{NAME}, "nossl", 0) ); + if( $nonblocking ) { HttpUtils_NonblockingGet({ - url => 'https://api.netatmo.net/oauth2/token', + url => "$https://api.netatmo.net/oauth2/token", timeout => 10, noshutdown => 1, data => {grant_type => 'refresh_token', client_id => $hash->{client_id}, client_secret=> $hash->{client_secret}, refresh_token => $hash->{refresh_token}}, @@ -204,7 +210,7 @@ netatmo_refreshToken($;$) }); } else { my($err,$data) = HttpUtils_BlockingGet({ - url => 'https://api.netatmo.net/oauth2/token', + url => "$https://api.netatmo.net/oauth2/token", timeout => 10, noshutdown => 1, data => {grant_type => 'refresh_token', client_id => $hash->{client_id}, client_secret=> $hash->{client_secret}, refresh_token => $hash->{refresh_token}}, @@ -878,6 +884,8 @@ netatmo_Attr($$$) the interval in seconds used to check for new values.
  • disable
    1 -> stop polling
  • +
  • nossl
    + 1 -> don't use ssl.