diff service/arduinoNode/devices.py @ 1110:6ee834a6f970

influx output for arduino, update web lib path Ignore-this: 76b7fb15db86563ed3fa1ec5322b918c darcs-hash:98a4e100e4951c3260bf5d713e2fa079b24af338
author drewp <drewp@bigasterisk.com>
date Fri, 16 Sep 2016 01:16:12 -0700
parents 054fccde9a49
children a94f2a522d41
line wrap: on
line diff
--- a/service/arduinoNode/devices.py	Fri Sep 16 00:55:04 2016 -0700
+++ b/service/arduinoNode/devices.py	Fri Sep 16 01:16:12 2016 -0700
@@ -286,6 +286,7 @@
     DS18S20 pin 1: ground, pin 2: data and pull-up with 4.7k.
     """
     deviceType = ROOM['OneWire']
+    pollPeriod = 2
     def hostStateInit(self):
         # eliminate this as part of removing watchPrefixes
         self._knownTempSubjects = set()
@@ -343,6 +344,12 @@
             addr = struct.unpack('>Q', read(8))[0]
             tempF = struct.unpack('<f', read(4))[0]
             sensorUri = URIRef(os.path.join(self.uri, 'dev-%s' % hex(addr)[2:]))
+            if tempF > 180:
+                stmts.extend([
+                    (self.uri, ROOM['connectedTo'], sensorUri),
+                    (sensorUri, RDF.type, ROOM['FailingTemperatureReading']),
+                    ])
+                continue
             stmts.extend([
                 (self.uri, ROOM['connectedTo'], sensorUri),
                 # rounding may be working around a bug where the