From 5f74d6de02eb638f7c80160ac2bd372dd744dc13 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Fri, 5 Jan 2024 12:26:58 -0500 Subject: [PATCH] Add 'M' prefix for indicating manual shift mode --- py/hexagram/tacho.py | 8 +++++--- py/hexagram/trans.py | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/py/hexagram/tacho.py b/py/hexagram/tacho.py index f60db59..0f7850c 100644 --- a/py/hexagram/tacho.py +++ b/py/hexagram/tacho.py @@ -60,9 +60,11 @@ class Tacho(Dial): def gear_text(self): text = '' - if self.shift_mode.value >= ShiftMode.SPORT.value \ - and self.gear.value >= Gear.GEAR_1.value: - text += 'S' + if self.gear.value >= Gear.GEAR_1.value: + if self.shift_mode is ShiftMode.SPORT or self.shift_mode is ShiftMode.RACE: + text += 'S' + elif self.shift_mode is ShiftMode.MANUAL: + text += 'M' text += str(self.gear) diff --git a/py/hexagram/trans.py b/py/hexagram/trans.py index a86bb00..cf67476 100644 --- a/py/hexagram/trans.py +++ b/py/hexagram/trans.py @@ -28,9 +28,10 @@ class ShiftMode(enum.Enum): ECO = 2 SPORT = 3 RACE = 4 + MANUAL = 5 __strings__ = { - 0: 'Normal', 1: 'Comfort', 2: 'Eco', 3: 'Sport', 4: 'Race' + 0: 'Normal', 1: 'Comfort', 2: 'Eco', 3: 'Sport', 4: 'Race', 5: 'Manual' } def __str__(self):