auto updates
This commit is contained in:
@@ -526,7 +526,7 @@ class FrogPilotVariables:
|
||||
toggle.always_on_lateral_main = toggle.always_on_lateral and not prohibited_main_aol and not toggle.always_on_lateral_lkas
|
||||
toggle.always_on_lateral_pause_speed = self.get_value("PauseAOLOnBrake", cast=float, condition=toggle.always_on_lateral)
|
||||
|
||||
toggle.automatic_updates = self.get_value("AutomaticUpdates", condition=(self.release_branch or self.vetting_branch or self.frogs_go_moo), default=True) and not BACKUP_PATH.is_file()
|
||||
toggle.automatic_updates = self.get_value("AutomaticUpdates") and not BACKUP_PATH.is_file()
|
||||
|
||||
car_model = normalize_legacy_car_model(self.params.get("CarModel"))
|
||||
if car_model != self.params.get("CarModel"):
|
||||
|
||||
@@ -462,6 +462,8 @@ def main() -> None:
|
||||
|
||||
# FrogPilot variables
|
||||
frogpilot_toggles = get_frogpilot_toggles()
|
||||
automatic_updates_enabled = getattr(frogpilot_toggles, "automatic_updates", True)
|
||||
user_requested_action = wait_helper.user_request != UserRequest.NONE
|
||||
|
||||
manual_update_requested = params_memory.get_bool("ManualUpdateInitiated")
|
||||
params_memory.remove("ManualUpdateInitiated")
|
||||
@@ -482,7 +484,7 @@ def main() -> None:
|
||||
|
||||
update_failed_count += 1
|
||||
|
||||
if manual_update_requested or params.get_bool("IsOffroad"):
|
||||
if manual_update_requested or user_requested_action or (params.get_bool("IsOffroad") and automatic_updates_enabled):
|
||||
# check for update
|
||||
params.put("UpdaterState", "checking...")
|
||||
updater.check_for_update()
|
||||
@@ -499,7 +501,10 @@ def main() -> None:
|
||||
updater.fetch_update()
|
||||
write_time_to_param(params, "UpdaterLastFetchTime")
|
||||
else:
|
||||
cloudlog.info("skipping fetch, vehicle is onroad")
|
||||
if not params.get_bool("IsOffroad"):
|
||||
cloudlog.info("skipping fetch, vehicle is onroad")
|
||||
else:
|
||||
cloudlog.info("skipping fetch, automatic updates disabled")
|
||||
update_failed_count = 0
|
||||
except subprocess.CalledProcessError as e:
|
||||
cloudlog.event(
|
||||
|
||||
Reference in New Issue
Block a user