|
@@ -15,13 +15,13 @@ l = sys.stdin.readline() |
|
|
data = json.loads(l.split(" ", 2)[2]) |
|
|
data = json.loads(l.split(" ", 2)[2]) |
|
|
proddata = data["production"][1] |
|
|
proddata = data["production"][1] |
|
|
condata = data["consumption"][0] |
|
|
condata = data["consumption"][0] |
|
|
print "\t%s\t%s\t%.03f\t%s\t%.03f\t%.03f\t%.03f" % (proddata["whToday"], proddata["whLastSevenDays"], float(proddata["whLastSevenDays"]) / 7, proddata["whLifetime"], condata["whToday"], condata["whLastSevenDays"], float(condata["whLastSevenDays"]) / 7)' |
|
|
|
|
|
|
|
|
print "\t%14.03f\t%14.03f\t%14.03f\t%14.03f\t%14.03f\t%14.03f\t%14.03f" % (float(proddata["whToday"]), float(proddata["whLastSevenDays"]), float(proddata["whLastSevenDays"]) / 7, float(proddata["whLifetime"]), float(condata["whToday"]), float(condata["whLastSevenDays"]), float(condata["whLastSevenDays"]) / 7)' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
startepoch=$(getutctime "$startday") |
|
|
startepoch=$(getutctime "$startday") |
|
|
now=$(date +%s) |
|
|
now=$(date +%s) |
|
|
|
|
|
|
|
|
printf "Date\t\twH\t\tlast 7\t\tavg last 7\tlifetime\tconsum today\tcon last 7\tcon last 7 avg\n" |
|
|
|
|
|
|
|
|
printf "Date\t\t%14s\t%14s\t%14s\t%14s\t%14s\t%14s\t%14s\n" wH "last 7" "avg last 7" "lifetime" "consum today" "con last 7" "con last 7 avg" |
|
|
while [ "$startepoch" -le "$now" ]; do |
|
|
while [ "$startepoch" -le "$now" ]; do |
|
|
echo -n $(date -r "$startepoch" +%F) |
|
|
echo -n $(date -r "$startepoch" +%F) |
|
|
getwhday "$startepoch" |
|
|
getwhday "$startepoch" |
|
|