|
|
@ -40,9 +40,10 @@ import weewx.drivers
|
|
|
|
import weewx.engine
|
|
|
|
import weewx.engine
|
|
|
|
import weewx.units
|
|
|
|
import weewx.units
|
|
|
|
import weewx.wxformulas
|
|
|
|
import weewx.wxformulas
|
|
|
|
|
|
|
|
import weeutil.weeutil
|
|
|
|
|
|
|
|
|
|
|
|
DRIVER_NAME = 'netatmo'
|
|
|
|
DRIVER_NAME = 'netatmo'
|
|
|
|
DRIVER_VERSION = "0.11"
|
|
|
|
DRIVER_VERSION = "0.12"
|
|
|
|
|
|
|
|
|
|
|
|
INHG_PER_MBAR = 0.0295299830714
|
|
|
|
INHG_PER_MBAR = 0.0295299830714
|
|
|
|
MPH_TO_KPH = 1.60934
|
|
|
|
MPH_TO_KPH = 1.60934
|
|
|
@ -323,6 +324,9 @@ class CloudClient(Collector):
|
|
|
|
logdbg("waiting %s seconds before retry" %
|
|
|
|
logdbg("waiting %s seconds before retry" %
|
|
|
|
self._retry_wait)
|
|
|
|
self._retry_wait)
|
|
|
|
time.sleep(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:
|
|
|
|
else:
|
|
|
|
logerr("failed to get data after %d attempts" %
|
|
|
|
logerr("failed to get data after %d attempts" %
|
|
|
|
self._max_tries)
|
|
|
|
self._max_tries)
|
|
|
@ -356,7 +360,9 @@ class CloudClient(Collector):
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def extract_data(x, units_dict):
|
|
|
|
def extract_data(x, units_dict):
|
|
|
|
"""Extract data we care about from a device or module"""
|
|
|
|
"""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:
|
|
|
|
for n in CloudClient.META_ITEMS:
|
|
|
|
if n in x:
|
|
|
|
if n in x:
|
|
|
|
data[n] = x[n]
|
|
|
|
data[n] = x[n]
|
|
|
|