From 1af3c7fb37c19318d602ba90f115498e5bb52b90 Mon Sep 17 00:00:00 2001 From: Florian Bezannier Date: Mon, 10 May 2021 20:39:49 +0200 Subject: [PATCH] always put electric energy first in the array --- libs/car_status.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/car_status.py b/libs/car_status.py index 392a587..8d61c94 100644 --- a/libs/car_status.py +++ b/libs/car_status.py @@ -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: