Browse Source

add avg for last 7 days consumption... limit precision..

main
John-Mark Gurney 4 years ago
parent
commit
3b5c10a669
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      getdailyprod.sh

+ 2
- 2
getdailyprod.sh View File

@@ -15,13 +15,13 @@ l = sys.stdin.readline()
data = json.loads(l.split(" ", 2)[2])
proddata = data["production"][1]
condata = data["consumption"][0]
print "\t%s\t%s\t%s\t%s\t%.03f\t%.03f" % (proddata["whToday"], proddata["whLastSevenDays"], float(proddata["whLastSevenDays"]) / 7, proddata["whLifetime"], condata["whToday"], condata["whLastSevenDays"])'
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)'
}

startepoch=$(getutctime "$startday")
now=$(date +%s)

printf "Date\t\twH\t\tlast 7\t\tavg last 7\tlifetime\tconsum today\tcon last 7\n"
printf "Date\t\twH\t\tlast 7\t\tavg last 7\tlifetime\tconsum today\tcon last 7\tcon last 7 avg\n"
while [ "$startepoch" -le "$now" ]; do
echo -n $(date -r "$startepoch" +%F)
getwhday "$startepoch"


Loading…
Cancel
Save