# HG changeset patch # User drewp@bigasterisk.com # Date 1453978134 28800 # Node ID 4e91f3ec460b6ddaf34f799e0101fa85b72fd520 # Parent c89f88cbdcc6e395334ed4c3f086c5c1a21ce903 more round() workarounds for mismatching literals not patching themselves out Ignore-this: 9e173ff490ca2b4cea54ffad40beed49 diff -r c89f88cbdcc6 -r 4e91f3ec460b service/piNode/devices.py --- a/service/piNode/devices.py Thu Jan 28 02:48:18 2016 -0800 +++ b/service/piNode/devices.py Thu Jan 28 02:48:54 2016 -0800 @@ -206,13 +206,14 @@ stmts = set() if humid is not None: - stmts.add((self.uri, ROOM['humidity'], Literal(humid))) + stmts.add((self.uri, ROOM['humidity'], Literal(round(humid, 2)))) else: stmts.add((self.uri, RDFS['comment'], Literal('DHT read returned None'))) if tempC is not None: stmts.add((self.uri, ROOM['temperatureF'], - Literal(tempC * 9 / 5 + 32))) + # see round() note in arduinoNode/devices.py + Literal(round(tempC * 9 / 5 + 32, 2)))) else: stmts.add((self.uri, RDFS['comment'], Literal('DHT read returned None'))) @@ -253,7 +254,8 @@ try: tempF = sensor.get_temperature(sensor.DEGREES_F) stmts.append((sensor.uri, ROOM['temperatureF'], - Literal(tempF))) + # see round() note in arduinoNode/devices.py + Literal(round(tempF, 2)))) except w1thermsensor.core.SensorNotReadyError as e: log.warning(e)