From b027a88f073c39478027865378d04e11a2f80824 Mon Sep 17 00:00:00 2001 From: Johann Krasinger Date: Thu, 25 Mar 2021 16:49:19 +0400 Subject: [PATCH] Changed stale values in get_data to avoid missing rain data --- .gitignore | 1 + bin/user/netatmo.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e110564..2abfbdf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *~ *.pyc src +.idea diff --git a/bin/user/netatmo.py b/bin/user/netatmo.py index b45cbcd..ad358a7 100644 --- a/bin/user/netatmo.py +++ b/bin/user/netatmo.py @@ -57,7 +57,7 @@ pvers = sys.version_info.major DRIVER_NAME = 'netatmo' -DRIVER_VERSION = "0.16" +DRIVER_VERSION = "0.17" INHG_PER_MBAR = 0.0295299830714 MPH_TO_KPH = 1.60934 @@ -552,7 +552,7 @@ def __init__(self, auth): self._last_update = 0 self._raw_data = dict() - def get_data(self, device_id=None, stale=300): + def get_data(self, device_id=None, stale=60): # changed to 60 from 300 to avoid missing data if int(time.time()) - self._last_update > stale: params = {'access_token': self._auth.access_token} if device_id: @@ -569,7 +569,7 @@ def __init__(self, auth): self._last_update = 0 self._raw_data = dict() - def get_data(self, device_id, module_id, stale=300): + def get_data(self, device_id, module_id, stale=60): # changed to 60 from 300 to avoid missing data if int(time.time()) - self._last_update > stale: # date_begin = int(datetime.datetime.now().timestamp()) - 30 * 60 date_begin = int(time.time()) - 30 * 60