Add next scan ETA display and update app state with scan timing information

This commit is contained in:
Jokob @NetAlertX
2026-03-03 04:07:22 +00:00
parent 95f411d92a
commit ab74307ed1
24 changed files with 254 additions and 8 deletions

View File

@@ -124,8 +124,16 @@ def main():
# last time any scan or maintenance/upkeep was run
conf.last_scan_run = loop_start_time
# Header
updateState("Process: Start")
# Compute the next scheduled run time across enabled device_scanner plugins
scanner_prefixes = {p["unique_prefix"] for p in all_plugins if p.get("plugin_type") == "device_scanner"}
scanner_next = [s.last_next_schedule for s in conf.mySchedules if s.service in scanner_prefixes]
next_scan_dt = min(scanner_next, default=None)
next_scan_time_iso = next_scan_dt.replace(microsecond=0).isoformat() if next_scan_dt else ""
# Header (also broadcasts last_scan_run + next_scan_time to frontend via SSE / app_state.json)
updateState("Process: Start",
last_scan_run=loop_start_time.replace(microsecond=0).isoformat(),
next_scan_time=next_scan_time_iso)
# Timestamp
startTime = loop_start_time