Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added crontab and record_temperature to support check_temperature.

  • Loading branch information...
commit 33c503591b2ab1876f661d7b04b8ed05c1d78c9f 1 parent 1202037
@pkropf pkropf authored
Showing with 20 additions and 0 deletions.
  1. +1 −0  temperature/crontab
  2. +19 −0 temperature/record_temperature
View
1  temperature/crontab
@@ -0,0 +1 @@
+0,15,30,45 * * * * /var/temperature/record_temperature.py > /var/temperature/run.log 2>&1
View
19 temperature/record_temperature
@@ -0,0 +1,19 @@
+#! /usr/bin/env python
+
+import os
+import ow
+from datetime import datetime
+
+ow.init('u')
+ow.opt('F')
+
+t = ow.Sensor('/10.54BA4D000800')
+temperature = t.temperature
+
+f = open('/var/temperature/latest', 'w')
+f.write('%f' % float(temperature))
+f.close()
+
+f = open('/var/temperature/log', 'a')
+f.write('%s %f%s' % (str(datetime.now()), float(temperature), os.linesep))
+f.close()
Please sign in to comment.
Something went wrong with that request. Please try again.