From fa42cd542699225e3b1f669be7f2f8b715db03fa Mon Sep 17 00:00:00 2001 From: neon-dev <1169307+neon-dev@users.noreply.github.com> Date: Sat, 14 Dec 2019 19:45:16 +0100 Subject: [PATCH] fix TeslaModel param file wasn't read correctly due to python 3 changes (#135) --- selfdrive/car/tesla/carstate.py | 2 ++ selfdrive/car/tesla/interface.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/selfdrive/car/tesla/carstate.py b/selfdrive/car/tesla/carstate.py index 226feaf4a7a39a..e838944225a50a 100644 --- a/selfdrive/car/tesla/carstate.py +++ b/selfdrive/car/tesla/carstate.py @@ -250,6 +250,8 @@ def __init__(self, CP): # Tesla Model self.teslaModelDetected = 1 self.teslaModel = read_db('/data/params','TeslaModel') + if self.teslaModel is not None: + self.teslaModel = self.teslaModel.decode() if self.teslaModel is None: self.teslaModel = "S" self.teslaModelDetected = 0 diff --git a/selfdrive/car/tesla/interface.py b/selfdrive/car/tesla/interface.py index 8b6e1d03364bbf..270ca8db2528ef 100644 --- a/selfdrive/car/tesla/interface.py +++ b/selfdrive/car/tesla/interface.py @@ -103,6 +103,8 @@ def get_params(candidate, fingerprint, vin="", is_panda_black=False): ret.isPandaBlack = is_panda_black teslaModel = read_db('/data/params','TeslaModel') + if teslaModel is not None: + teslaModel = teslaModel.decode() if teslaModel is None: teslaModel = "S"