Metrics: align 15min profile aggregation with local time (#23779)
Co-authored-by: Felix Kiechle <felix.kiechle@stryker.com>
This commit is contained in:
parent
1633068586
commit
0d2407e12a
1 changed files with 3 additions and 2 deletions
|
|
@ -36,11 +36,12 @@ func Profile(from time.Time) (*[96]float64, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Use 'localtime' in strftime to fix https://github.com/evcc-io/evcc/discussions/23759
|
||||
rows, err := db.Query(`SELECT min(ts) AS ts, avg(val) AS val
|
||||
FROM meters
|
||||
WHERE meter = ? AND ts >= ?
|
||||
GROUP BY strftime("%H:%M", ts)
|
||||
ORDER BY strftime("%H:%M", ts) ASC`, 1, from,
|
||||
GROUP BY strftime("%H:%M", ts, 'localtime')
|
||||
ORDER BY strftime("%H:%M", ts, 'localtime') ASC`, 1, from,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue