Skip to content

Commit

Permalink
Use the name of the car from the Session rather than hard-coding.
Browse files Browse the repository at this point in the history
This allows it to say 'Leaf' for leafs and 'Tesla' for teslas.

Signed-off-by: Ashley Pittman <ashley@pittman.co.uk>
  • Loading branch information
ashleypittman committed Jul 29, 2020
1 parent 3deb467 commit be14be0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mec/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def sample(self, conn, sessions, culm_values, sockets):
car = 'Unknown'
if sessions[zappi.sno]['se'].session._is_valid:
session = sessions[zappi.sno]['se'].session
car = 'Leaf ({:.0f}%)'.format(session.percent_charge())
car = '{} ({:.0f}%)'.format(session.name, session.percent_charge())
elif sessions[zappi.sno]['se'].session._is_valid is False:
car = 'Outlander'
if zappi.status == 'Hot':
Expand Down
2 changes: 2 additions & 0 deletions mec/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class TeslaSession(CommonSession):

capacity = 70
charge_rate = 7200
name = 'Tesla'

def __init__(self, conf, mt):
super().__init__(conf['tesla'])
Expand Down Expand Up @@ -233,6 +234,7 @@ class LeafSession(CommonSession):
# go from 0-100%. Used for SOC calculations.
capacity = 26
charge_rate = 6600
name = 'Leaf'

def __init__(self, conf, py):
super().__init__(conf['leaf'])
Expand Down

0 comments on commit be14be0

Please sign in to comment.