Reports previously used the raw delta between whichever real readings happened to fall nearest a period's start/end, un-prorated — accurate only when readings land close to calendar boundaries. With sparse readings this misattributes days on either side to the neighbouring period instead. getPeriodConsumption() now interpolates the meter's value at each boundary between the readings bracketing it (linear by day-count), then diffs those — equivalent to a "daily rate carried forward until the next reading" spreadsheet approach, generalised across however many sparse-reading gaps a period spans. Falls back to the old nearest-reading behaviour when a boundary can't be interpolated (period starts before the first-ever reading or ends after the latest one). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Dockerfile | ||
| package.json | ||