diff service/piNode/export_to_influxdb.py @ 304:e7cbf250188a

influx output, fade support, switch to Adafruit_DHT, start of Lcd8544 Ignore-this: dd9cae16daafd780a301728a1ce8eb38
author drewp@bigasterisk.com
date Fri, 16 Sep 2016 00:55:04 -0700
parents fc0e42933baa
children
line wrap: on
line diff
--- a/service/piNode/export_to_influxdb.py	Mon Aug 29 00:27:46 2016 -0700
+++ b/service/piNode/export_to_influxdb.py	Fri Sep 16 00:55:04 2016 -0700
@@ -20,8 +20,6 @@
         graph = self.graph
         now = int(time.time())
       
-        log.debug('influxdb export:')
-
         points = []
         for stmt in currentStatements:
             if (stmt[0], stmt[1]) in self.measurements:
@@ -49,9 +47,9 @@
             self.influx.write_points(points, time_precision='s')
 
     def influxValue(self, rdfValue):
-        if rdfValue == ROOM['motion']:
+        if rdfValue in [ROOM['motion'], ROOM['pressed']]:
             value = 1
-        elif rdfValue == ROOM['noMotion']:
+        elif rdfValue in [ROOM['noMotion'], ROOM['notPressed']]:
             value = 0
         else:
             value = rdfValue.toPython()