comparison service/piNode/devices.py @ 1441:94bb8408e6ed

fix precision of ledstrip paras Ignore-this: d0841f1170755b08cb63de8f8af776c6 darcs-hash:a89893534e614b3f821c212e7a648050cc6cc176
author drewp <drewp@bigasterisk.com>
date Mon, 12 Aug 2019 10:08:23 -0700
parents 233a07f068a8
children
comparison
equal deleted inserted replaced
1440:2e9361f233f2 1441:94bb8408e6ed
524 def poll(self): 524 def poll(self):
525 milliC = open('/sys/class/thermal/thermal_zone0/temp').read().strip() 525 milliC = open('/sys/class/thermal/thermal_zone0/temp').read().strip()
526 c = float(milliC) / 1000. 526 c = float(milliC) / 1000.
527 f = c * 1.8 + 32 527 f = c * 1.8 + 32
528 return [ 528 return [
529 (self.uri, ROOM['temperatureF'], Literal(f, datatype=XSD['decimal'])), 529 (self.uri, ROOM['temperatureF'], Literal(round(f, 3), datatype=XSD['decimal'])),
530 ] 530 ]
531 531
532 def watchPrefixes(self): 532 def watchPrefixes(self):
533 # these uris will become dynamic! see note on watchPrefixes 533 # these uris will become dynamic! see note on watchPrefixes
534 # about eliminating it. 534 # about eliminating it.