This commit is contained in:
Your Name
2024-05-08 23:06:12 -05:00
parent f8e3d83cda
commit 013dae2443
10 changed files with 132 additions and 55 deletions

View File

@@ -65,9 +65,6 @@ def frogpilot_thread():
CP = None
automatic_updates = params.get_bool("AutomaticUpdates")
first_run = True
model_list_empty = params.get("AvailableModelsNames", encoding='utf-8') is None
time_validated = system_time_valid()
pm = messaging.PubMaster(['frogpilotPlan'])
@@ -93,37 +90,15 @@ def frogpilot_thread():
sm['liveLocationKalman'], sm['modelV2'], sm['radarState'])
frogpilot_planner.publish(sm, pm)
if params_memory.get("ModelToDownload", encoding='utf-8') is not None and github_pinged():
download_model()
if params_memory.get_bool("FrogPilotTogglesUpdated"):
automatic_updates = params.get_bool("AutomaticUpdates")
if not params.get_bool("ModelSelector"):
params.put("Model", DEFAULT_MODEL)
params.put("ModelName", DEFAULT_MODEL_NAME)
if started:
frogpilot_planner.update_frogpilot_params()
else:
frogpilot_functions.backup_toggles()
if not time_validated:
time_validated = system_time_valid()
if not time_validated:
continue
if datetime.datetime.now().second == 0 or first_run or model_list_empty or params_memory.get_bool("ManualUpdateInitiated"):
if not started or model_list_empty:
time_checks(automatic_updates, deviceState, params)
model_list_empty = params.get("AvailableModelsNames", encoding='utf-8') is None
theme_manager.update_holiday()
first_run = False
time.sleep(DT_MDL)
def main():
frogpilot_thread()