mirror of
https://github.com/bricebou/weewx-netatmo.git
synced 2025-01-18 12:01:11 +01:00
added logging for unknown exceptions in client. deal with missing utc times.
This commit is contained in:
parent
4f78f1e41e
commit
cfd721636e
3 changed files with 12 additions and 3 deletions
|
@ -40,9 +40,10 @@ import weewx.drivers
|
|||
import weewx.engine
|
||||
import weewx.units
|
||||
import weewx.wxformulas
|
||||
import weeutil.weeutil
|
||||
|
||||
DRIVER_NAME = 'netatmo'
|
||||
DRIVER_VERSION = "0.11"
|
||||
DRIVER_VERSION = "0.12"
|
||||
|
||||
INHG_PER_MBAR = 0.0295299830714
|
||||
MPH_TO_KPH = 1.60934
|
||||
|
@ -323,6 +324,9 @@ class CloudClient(Collector):
|
|||
logdbg("waiting %s seconds before retry" %
|
||||
self._retry_wait)
|
||||
time.sleep(self._retry_wait)
|
||||
except Exception, e:
|
||||
logerr("exception in netatmo-client: %s" % e)
|
||||
weeutil.weeutil.log_traceback('*** ', syslog.LOG_DEBUG)
|
||||
else:
|
||||
logerr("failed to get data after %d attempts" %
|
||||
self._max_tries)
|
||||
|
@ -356,7 +360,9 @@ class CloudClient(Collector):
|
|||
@staticmethod
|
||||
def extract_data(x, units_dict):
|
||||
"""Extract data we care about from a device or module"""
|
||||
data = {'time_utc': x['dashboard_data']['time_utc']}
|
||||
data = dict()
|
||||
if 'time_utc' in x['dashboard_data']:
|
||||
data['time_utc'] = x['dashboard_data']['time_utc']
|
||||
for n in CloudClient.META_ITEMS:
|
||||
if n in x:
|
||||
data[n] = x[n]
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
0.12 11sep2018
|
||||
* deal with missing time_utc from server
|
||||
|
||||
0.11 08jul2018
|
||||
* explicitly catch socket timeouts since URLError does not in python 2.7
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ def loader():
|
|||
class NetatmoInstaller(ExtensionInstaller):
|
||||
def __init__(self):
|
||||
super(NetatmoInstaller, self).__init__(
|
||||
version="0.11",
|
||||
version="0.12",
|
||||
name='netatmo',
|
||||
description='Driver for netatmo weather stations.',
|
||||
author="Matthew Wall",
|
||||
|
|
Loading…
Reference in a new issue