Migrate records to solar web format
Deploy Solar Relay / deploy (push) Successful in 1m3s

This commit is contained in:
franzz committed 2026-11-02 23:49:24 +01:00
1 parent 89621bc7c3
commit e1d22a26ed
6 files changed
+146 -20

No files matched your search

+6
View File
@@ -40,6 +40,9 @@ def next_poll_at(now, interval):
def _run(config, store):
normalized = store.normalize_history()
if normalized:
LOG.info("Normalized %d recovered records to common power readings", normalized)
stop = threading.Event()
previous = {}
uploader = Uploader(config.upload, store) if config.upload.url else None
@@ -103,6 +106,7 @@ def _parser():
commands.add_parser("upload", help="Upload the pending queue, stopping on the first failure")
commands.add_parser("status", help="Show local archive/queue status without contacting the inverter")
commands.add_parser("prune", help="Delete expired whole local days after acknowledgement retention")
commands.add_parser("normalize-history", help="Backfill common power readings in previously recovered records")
for name, help_text in [
("export", "Export archived samples as JSON Lines, including already uploaded samples"),
("replay", "Requeue archived samples for upload, preserving their IDs"),
@@ -137,6 +141,8 @@ def main(argv=None):
print(json.dumps(store.status(), indent=2))
elif args.command == "prune":
print(json.dumps({"deleted": store.prune()}))
elif args.command == "normalize-history":
print(json.dumps({"normalized": store.normalize_history()}))
elif args.command == "recover":
if not config.history.enabled:
raise ValueError("Enable history and configure Solar.web account credentials before recovery")