IQ.Pilot Prebuilt Release @ 27f668a
This commit is contained in:
26
iqpilot/selfdrive/car/refresh_car_list.py
Normal file
26
iqpilot/selfdrive/car/refresh_car_list.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos
|
||||
"""
|
||||
from iqpilot.common.params import Params
|
||||
from iqpilot.common.swaglog import cloudlog
|
||||
from iqpilot.selfdrive.car.vehicle_catalog import load_catalog
|
||||
|
||||
|
||||
def refresh_car_list_param() -> None:
|
||||
platforms = load_catalog()
|
||||
if not platforms:
|
||||
cloudlog.warning("vehicle catalog not found; leaving CarList param unchanged")
|
||||
return
|
||||
|
||||
params = Params()
|
||||
if params.get("CarList") == platforms:
|
||||
cloudlog.warning("CarList param already current, nothing to write")
|
||||
return
|
||||
|
||||
params.put("CarList", platforms)
|
||||
cloudlog.warning("CarList param refreshed from vehicle catalog")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
refresh_car_list_param()
|
||||
Reference in New Issue
Block a user