wip
This commit is contained in:
@@ -21,17 +21,19 @@ from openpilot.selfdrive.frogpilot.controls.lib.theme_manager import ThemeManage
|
||||
|
||||
WIFI = log.DeviceState.NetworkType.wifi
|
||||
|
||||
# clearpilot disabled
|
||||
def automatic_update_check(params):
|
||||
update_available = params.get_bool("UpdaterFetchAvailable")
|
||||
update_ready = params.get_bool("UpdateAvailable")
|
||||
update_state = params.get("UpdaterState", encoding='utf8')
|
||||
return
|
||||
# update_available = params.get_bool("UpdaterFetchAvailable")
|
||||
# update_ready = params.get_bool("UpdateAvailable")
|
||||
# update_state = params.get("UpdaterState", encoding='utf8')
|
||||
|
||||
if update_ready:
|
||||
HARDWARE.reboot()
|
||||
elif update_available:
|
||||
os.system("pkill -SIGHUP -f selfdrive.updated.updated")
|
||||
elif update_state == "idle":
|
||||
os.system("pkill -SIGUSR1 -f selfdrive.updated.updated")
|
||||
# if update_ready:
|
||||
# HARDWARE.reboot()
|
||||
# elif update_available:
|
||||
# os.system("pkill -SIGHUP -f selfdrive.updated.updated")
|
||||
# elif update_state == "idle":
|
||||
# os.system("pkill -SIGUSR1 -f selfdrive.updated.updated")
|
||||
|
||||
def github_pinged(url="https://github.com", timeout=5):
|
||||
try:
|
||||
@@ -40,15 +42,17 @@ def github_pinged(url="https://github.com", timeout=5):
|
||||
except (urllib.error.URLError, socket.timeout, http.client.RemoteDisconnected):
|
||||
return False
|
||||
|
||||
# clearpilot disabled
|
||||
def time_checks(automatic_updates, deviceState, params):
|
||||
if github_pinged():
|
||||
populate_models()
|
||||
return
|
||||
# if github_pinged():
|
||||
# populate_models()
|
||||
|
||||
screen_off = deviceState.screenBrightnessPercent == 0
|
||||
wifi_connection = deviceState.networkType == WIFI
|
||||
# screen_off = deviceState.screenBrightnessPercent == 0
|
||||
# wifi_connection = deviceState.networkType == WIFI
|
||||
|
||||
if automatic_updates and screen_off and wifi_connection:
|
||||
automatic_update_check(params)
|
||||
# if automatic_updates and screen_off and wifi_connection:
|
||||
# automatic_update_check(params)
|
||||
|
||||
def frogpilot_thread():
|
||||
config_realtime_process(5, Priority.CTRL_LOW)
|
||||
|
||||
Reference in New Issue
Block a user