jertel / vuegraf

Populate metrics from your Emporia Vue energy monitoring devices into an InfluxDB
MIT License
169 stars 54 forks source link

Fix collection of daily statistics past end-of-month #156

Closed cdolghier closed 9 months ago

cdolghier commented 9 months ago

vuegraf stops collecting daily statistics when a new month starts, because of pastDay.day < curDay.day (e.g. [28..31]) < 1 which is never true). A technically correct solution would be (pastDay.year, pastDay.month, pastDay.day) < (curDay.year, curDay.month, curDay.day) but assuming we don't have gaps longer than a month in a given process' lifetime, the simpler solution works as well.