Automatic updates

This commit is contained in:
James
2026-01-03 11:53:11 -07:00
parent 5cdc5b7991
commit 48e1f14229
7 changed files with 88 additions and 25 deletions
+5
View File
@@ -9,6 +9,7 @@ from openpilot.common.realtime import DT_MDL, Priority, Ratekeeper, config_realt
from openpilot.common.time_helpers import system_time_valid
from openpilot.frogpilot.common.frogpilot_backups import backup_toggles
from openpilot.frogpilot.common.frogpilot_functions import update_openpilot
from openpilot.frogpilot.common.frogpilot_utilities import ThreadManager, is_url_pingable
from openpilot.frogpilot.common.frogpilot_variables import FrogPilotVariables
from openpilot.frogpilot.controls.frogpilot_planner import FrogPilotPlanner
@@ -31,6 +32,9 @@ def update_checks(now, thread_manager, params, params_memory, frogpilot_toggles,
while not (is_url_pingable("https://github.com") or is_url_pingable("https://gitlab.com")):
time.sleep(60)
if frogpilot_toggles.automatic_updates:
thread_manager.run_with_lock(update_openpilot, (thread_manager, params))
time.sleep(1)
def update_toggles(frogpilot_variables, started, thread_manager, time_validated, params):
@@ -102,6 +106,7 @@ def frogpilot_thread():
if params_memory.get_bool("FrogPilotTogglesUpdated"):
frogpilot_toggles = update_toggles(frogpilot_variables, started, thread_manager, time_validated, params)
run_update_checks |= params_memory.get_bool("ManualUpdateInitiated")
run_update_checks |= now.second == 0 and (now.minute % 60 == 0)
run_update_checks &= time_validated