Initial commit of py/hexagram/trans.py

This commit is contained in:
XANTRONIX Development 2024-01-03 20:04:46 -05:00
parent 8f69f785a8
commit 2f0334b8c5

39
py/hexagram/trans.py Normal file
View file

@ -0,0 +1,39 @@
import enum
class Gear(enum.Enum):
R = -1
N = 0
GEAR_1 = 1
GEAR_2 = 2
GEAR_3 = 3
GEAR_4 = 4
GEAR_5 = 5
GEAR_6 = 6
GEAR_7 = 7
GEAR_8 = 8
GEAR_9 = 9
GEAR_10 = 10
__strings__ = {
-1: 'R', 0: 'N', 1: '1',
2: '2', 3: '3', 4: '4',
5: '5', 6: '6', 7: '7',
8: '8', 9: '9', 10: '10'
}
def __str__(self):
return self.__strings__.get(self.value, '?')
class ShiftMode(enum.Enum):
NORMAL = 0
COMFORT = 1
ECO = 2
SPORT = 3
RACE = 4
__strings__ = {
0: 'Normal', 1: 'Comfort', 2: 'Eco', 3: 'Sport', 4: 'Race'
}
def __str__(self):
return self.__strings__.get(self.value, '?')