Skip to content

Commit

Permalink
fix TeslaModel param file wasn't read correctly due to python 3 chang…
Browse files Browse the repository at this point in the history
…es (commaai#135)
  • Loading branch information
neon-dev authored Dec 14, 2019
1 parent a169fe4 commit fa42cd5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions selfdrive/car/tesla/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions selfdrive/car/tesla/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit fa42cd5

Please sign in to comment.