Add session infos (co2, price, solar %) (#7380)

This commit is contained in:
Michael Geers 2023-05-02 08:59:11 +02:00 • committed by GitHub
parent 6773536dcc
commit 9d14e3d446
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 706 additions and 218 deletions

View file

@ -69,7 +69,10 @@ func sessionHandler(w http.ResponseWriter, r *http.Request) {
// prepare data
for i, s := range res {
res[i].Odometer = math.Round(s.Odometer*10) / 10
if s.Odometer != nil {
odo := math.Round(*s.Odometer*10) / 10
res[i].Odometer = &odo
}
}
if r.URL.Query().Get("format") == "csv" {