Allow device to be offline indefinitely

Added button to allow the device to be offline indefinitely.
This commit is contained in:
FrogAi
2024-01-12 22:39:30 -07:00
parent c1a7f1e3b0
commit c33e3e45db
5 changed files with 19 additions and 1 deletions

View File

@@ -194,6 +194,7 @@ def finalize_update() -> None:
# FrogPilot update functions
params = Params()
params.put("Updated", datetime.datetime.now().astimezone(ZoneInfo('America/Phoenix')).strftime("%B %d, %Y - %I:%M%p"))
params.remove("OfflineMode") # Reset the param since the user has internet connection again
def handle_agnos_update() -> None:
from openpilot.system.hardware.tici.agnos import flash_agnos_update, get_target_slot_number
@@ -226,6 +227,7 @@ class Updater:
self._has_internet: bool = False
# FrogPilot variables
self.disable_internet_check = self.params.get_bool("OfflineMode")
@property
def has_internet(self) -> bool:
@@ -318,6 +320,8 @@ class Updater:
set_offroad_alert(alert, False)
now = datetime.datetime.utcnow()
if self.disable_internet_check:
last_update = now
dt = now - last_update
if failed_count > 15 and exception is not None and self.has_internet:
if is_tested_branch():