Also, don't use mathlib with `bc`, as it's not needed, and only adds
spurious fractional bytes to the computed ideal usage.
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This includes caching of the inverter info with a 12h TTL, so the graph
still renders when the inverter has gone to sleep at night.
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
squash! [plugins/solar/fronius] Monitor Solar Inverters using the Fronius Solar API
Use generic caching function to also cache real-time data. This allows
to avoid N/As overnight, which don't aggregate nicely on the yearly
graph.
The API tends to be unstable and often fail with a 500,
which makes the plugin disappear. Keeping a cache allows
to prevent some flickering of the graph.
This allows us to further split config data-fetching from live
data-fetching, thus removing the need to support DIRTYCONFIG.
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
We need to set the date for all plugins, otherwise the lagging `daily`
one is assumed for all, and confuses spoolfetch and other time-based
sanity checks.
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
Also make the daily graph more flexible, by always reporting the second
last value (presumably the previous, but sometimes the API lags a bit,
and actively requesting by date result in never reporting some late
data).
Signed-off-by: Olivier Mehani <shtrom@ssji.net>