diff web/log.py @ 432:b90e9c695cfd

merge
author Matt Johnston <matt@ucc.asn.au>
date Sun, 14 Oct 2012 21:52:00 +0800
parents ae12b30352f0
children d36fe81077cc
line wrap: on
line diff
--- a/web/log.py	Sun Oct 14 21:51:55 2012 +0800
+++ b/web/log.py	Sun Oct 14 21:52:00 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'])