diff web/log.py @ 431:ae12b30352f0

extra logging
author Matt Johnston <matt@ucc.asn.au>
date Sat, 13 Oct 2012 20:22:50 +0800
parents eb685e1afcbb
children d36fe81077cc
line wrap: on
line diff
--- a/web/log.py	Thu Oct 11 19:21:11 2012 +0800
+++ b/web/log.py	Sat Oct 13 20:22:50 2012 +0800
@@ -78,7 +78,7 @@
         elif 'fridge_on' in sensor:
             vname = 'fridge_on'
             graph_args.append('DEF:raw%(vname)s=%(rrdfile)s:temp:LAST' % locals())
-            graph_args.append('CDEF:%(vname)s=raw%(vname)s,3,+' % locals())
+            graph_args.append('CDEF:%(vname)s=raw%(vname)s,-0.2,*,3,+' % locals())
         else:
             vname = 'temp%d' % n
             graph_args.append('DEF:raw%(vname)s=%(rrdfile)s:temp:AVERAGE' % locals())
@@ -216,6 +216,10 @@
     if len(entries) != len(lines):
         raise Exception("Keys are not unique")
 
+    if 'sensors' not in entries:
+        # only debug info, it's been recorded
+        return
+
     num_sensors = int(entries['sensors'])
     num_measurements = int(entries['measurements'])