aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2016-03-31 22:45:10 +0200
committerVolker Hoffmann <volker@cheleb.net>2016-03-31 22:45:10 +0200
commiteb4241b5788a6f78f3b02aaeb130429d0d74c7e4 (patch)
tree2cda7ca8fde368ce6ea9ae90a046e3a5f32a40e8
parent61ce5110a013552a875ac81ccca897c108e61ca7 (diff)
fix: set both netatmo station and module when requesting data
-rw-r--r--Common/sensors.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Common/sensors.py b/Common/sensors.py
index 9f588ff..6517b53 100644
--- a/Common/sensors.py
+++ b/Common/sensors.py
@@ -5,11 +5,12 @@ Get Environmental Sensor Data.
import External.lnetatmo as lnetatmo
-def get_netatmo_temperature(station='zBox Room'):
+def get_netatmo_temperature(station='zBox', module='zBox Room'):
"""
Get Netatmo Temperature Data.
- @param: station - Name of sensor to poll [String]
+ @param: station - Name of Netatmo station to poll [String]
+ @param: module - Name of Netatmo module to poll [String]
@return: temperature - Temperature (Celsius) [Float]
@return: epoch - Unix Timestamp (Seconds) [Float]
"""
@@ -31,7 +32,7 @@ def get_netatmo_temperature(station='zBox Room'):
devList = lnetatmo.DeviceList(authorization)
# Get Data
- temperature = devList.lastData()[station]['Temperature']
- epoch = devList.lastData()[station]['When']
+ temperature = devList.lastData(station=station)[module]['Temperature']
+ epoch = devList.lastData(station=station)[module]['When']
return temperature, epoch