version: sunnypilot v2026.002.000 (staging) date: 2026-07-21T07:44:02 master commit: 2c334ede443d7391d27575af8c854a095ba702a8
32 lines
947 B
Python
Executable File
32 lines
947 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
|
|
|
|
This file is part of sunnypilot and is licensed under the MIT License.
|
|
See the LICENSE.md file in the root directory for more details.
|
|
"""
|
|
import json
|
|
import os
|
|
|
|
from openpilot.common.basedir import BASEDIR
|
|
from openpilot.common.params import Params
|
|
from openpilot.common.swaglog import cloudlog
|
|
|
|
CAR_LIST_JSON_OUT = os.path.join(BASEDIR, "openpilot", "sunnypilot", "selfdrive", "car", "car_list.json")
|
|
|
|
|
|
def update_car_list_param():
|
|
with open(CAR_LIST_JSON_OUT) as f:
|
|
current_car_list = json.load(f)
|
|
|
|
params = Params()
|
|
if params.get("CarList") != current_car_list:
|
|
params.put("CarList", current_car_list, block=True)
|
|
cloudlog.warning("Updated CarList param with latest platform list")
|
|
else:
|
|
cloudlog.warning("CarList param is up to date, no need to update")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
update_car_list_param()
|