always put electric energy first in the array

This commit is contained in:
Florian Bezannier
2021-05-10 20:39:49 +02:00
parent 007a53ac8c
commit 1af3c7fb37
+3
View File
@@ -23,6 +23,9 @@ class CarStatus(Status):
properties=PositionProperties(updated_at=None))
if self.kinetic is None:
self.kinetic = Kinetic()
# always put electric energy first
if len(self._energy) == 2 and self._energy[0].type != 'Electric':
self._energy = self._energy[::-1]
def is_moving(self):
try: