allow uploads

This commit is contained in:
firestar5683
2026-03-08 20:45:59 -05:00
parent 5ca3f503ee
commit c8f18d1497
28 changed files with 185 additions and 39 deletions
+4 -3
View File
@@ -258,15 +258,16 @@ def main(exit_event: threading.Event = None) -> None:
while not exit_event.is_set():
sm.update(0)
always_allow_uploads = params.get_bool("AlwaysAllowUploads")
offroad = params.get_bool("IsOffroad")
network_type = sm['deviceState'].networkType if not force_wifi else NetworkType.wifi
at_home = offroad and network_type in (NetworkType.ethernet, NetworkType.wifi) or not frogpilot_toggles.no_onroad_uploads
if network_type == NetworkType.none or not at_home:
at_home = always_allow_uploads or (offroad and network_type in (NetworkType.ethernet, NetworkType.wifi)) or not frogpilot_toggles.no_onroad_uploads
if ((network_type == NetworkType.none) and not always_allow_uploads) or not at_home:
if allow_sleep:
time.sleep(60 if offroad else 5)
continue
success = uploader.step(sm['deviceState'].networkType.raw, sm['deviceState'].networkMetered)
success = uploader.step(sm['deviceState'].networkType.raw, sm['deviceState'].networkMetered and not always_allow_uploads)
if success is None:
backoff = 60 if offroad else 5
elif success: