Permalink
Browse files

added crontab and record_temperature to support check_temperature.

  • Loading branch information...
1 parent 1202037 commit 33c503591b2ab1876f661d7b04b8ed05c1d78c9f @pkropf pkropf committed Mar 29, 2010
Showing with 20 additions and 0 deletions.
  1. +1 −0 temperature/crontab
  2. +19 −0 temperature/record_temperature
View
@@ -0,0 +1 @@
+0,15,30,45 * * * * /var/temperature/record_temperature.py > /var/temperature/run.log 2>&1
@@ -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()

0 comments on commit 33c5035

Please sign in to comment.