Fix dashcam missing CarState

pull/1309/head
Willem Melching 5 years ago
parent 6abbda1467
commit 0112a8d3fd
  1. 9
      selfdrive/car/car_helpers.py

@ -27,12 +27,17 @@ def load_interfaces(brand_names):
for brand_name in brand_names: for brand_name in brand_names:
path = ('selfdrive.car.%s' % brand_name) path = ('selfdrive.car.%s' % brand_name)
CarInterface = __import__(path + '.interface', fromlist=['CarInterface']).CarInterface CarInterface = __import__(path + '.interface', fromlist=['CarInterface']).CarInterface
if os.path.exists(BASEDIR + '/' + path.replace('.', '/') + '/carstate.py'):
CarState = __import__(path + '.carstate', fromlist=['CarState']).CarState
else:
CarState = None
if os.path.exists(BASEDIR + '/' + path.replace('.', '/') + '/carcontroller.py'): if os.path.exists(BASEDIR + '/' + path.replace('.', '/') + '/carcontroller.py'):
CarController = __import__(path + '.carcontroller', fromlist=['CarController']).CarController CarController = __import__(path + '.carcontroller', fromlist=['CarController']).CarController
CarState = __import__(path + '.carstate', fromlist=['CarState']).CarState
else: else:
CarController = None CarController = None
CarState = None
for model_name in brand_names[brand_name]: for model_name in brand_names[brand_name]:
ret[model_name] = (CarInterface, CarController, CarState) ret[model_name] = (CarInterface, CarController, CarState)
return ret return ret

Loading…
Cancel
Save