diff service/arduinoNode/devices.py @ 1035:f01d9892ed79

update arduinoNode to support streamed graph output Ignore-this: fa35d1fae5b0e411b167650550c3e77d darcs-hash:c22c59acf2d4bbabfc467085f146a5de72b19f03
author drewp <drewp@bigasterisk.com>
date Thu, 28 Jan 2016 02:24:32 -0800
parents 3e6fac8569cd
children 4ebb5cc30002
line wrap: on
line diff
--- a/service/arduinoNode/devices.py	Thu Jan 28 00:21:31 2016 -0800
+++ b/service/arduinoNode/devices.py	Thu Jan 28 02:24:32 2016 -0800
@@ -320,7 +320,11 @@
             sensorUri = URIRef(os.path.join(self.uri, 'dev-%s' % hex(addr)[2:]))
             stmts.extend([
                 (self.uri, ROOM['connectedTo'], sensorUri),
-                (sensorUri, ROOM['temperatureF'], Literal(tempF))])
+                # rounding may be working around a bug where the
+                # Literal gets two representations (at different
+                # roundings), and this makes an extra value linger on
+                # the client.
+                (sensorUri, ROOM['temperatureF'], Literal(round(tempF, 2)))])
             self._knownTempSubjects.add(sensorUri)
 
         log.debug("read temp in %.1fms" % ((time.time() - t1) * 1000))