Skip to content

Commit

Permalink
Changed stale values in get_data to avoid missing rain data
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrasinger committed Mar 25, 2021
1 parent a9b532c commit b027a88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*~
*.pyc
src
.idea
6 changes: 3 additions & 3 deletions bin/user/netatmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit b027a88

Please sign in to comment.