don't do the power_today.csv update
authorAndrew Tridgell <tridge@samba.org>
Sun, 10 Oct 2010 21:45:48 +0000 (08:45 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sun, 10 Oct 2010 21:45:48 +0000 (08:45 +1100)
webbox/sma-data.py

index c392d2b7c4c1c47d676d934ad295106ea2de91d1..78bdb319a1781963fb08a1e9093876ca829b0620 100755 (executable)
@@ -96,24 +96,6 @@ def append_file(fname, v):
     f.write(str(v))
     f.close()
 
-def power_today():
-    '''update power_today.csv'''
-    v = rpc_call({ "proc"    : "GetPlantOverview" })
-
-    res = extract_result(v, 'overview')
-    power = res['GriPwr']
-    e_today = res['GriEgyTdy']
-    time_str = time.strftime("%Y-%m-%d %H:%M")
-
-    last_power = float(load_file('lastminute.dat', 0))
-
-    if (not os.path.exists('power_today.csv') or
-        os.stat('power_today.csv').st_mtime < midnight()):
-        save_file('power_today.csv', "Time,Power (kW)\n")
-
-    append_file('power_today.csv', '%s,%.3f\n' % (time_str, e_today - last_power))
-    save_file('lastminute.dat', e_today)
-
 def all_values():
     '''get detailed inverter data'''
     v = rpc_call({ "proc" : "GetDevices" })
@@ -149,5 +131,4 @@ def all_values():
         if have_data:
             append_file(fname, line + '\n')
 
-power_today()
 all_values()