From 3096adfb48b5cd2fdbcf68894ef5a2fa6d0443a2 Mon Sep 17 00:00:00 2001 From: GPlay97 Date: Wed, 23 Oct 2019 18:42:44 +0200 Subject: [PATCH 1/2] implement CEC + CED for KONA --- cars/KONA_EV.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cars/KONA_EV.py b/cars/KONA_EV.py index bc494ad..f76fc2a 100644 --- a/cars/KONA_EV.py +++ b/cars/KONA_EV.py @@ -38,6 +38,10 @@ def getData(self): if 0x7EC22 in raw[220101] else None, 'batteryMinTemperature': int.from_bytes(raw[220101][0x7EC22][5:6], byteorder='big', signed=True) \ if 0x7EC22 in raw[220101] else None, + 'cumulativeEnergyCharged': int.from_bytes(raw[2101][0x7EC26][0:4], byteorder='big', signed=False) / 10.0 \ + if 0x7EC26 in raw[2101] else None, + 'cumulativeEnergyDischarged': int.from_bytes(raw[2101][0x7EC26][4:7] + raw[2101][0x7EC27][0:1], byteorder='big', signed=False) / 10.0 \ + if 0x7EC26 in raw[2101] and 0x7EC27 in raw[2101] else None, 'charging': 1 if chargingBits & 0xc == 0x8 else 0, 'normalChargePort': 1 if normalChargeBit and normalChargePort else 0, 'rapidChargePort': 1 if normalChargeBit and not normalChargePort else 0, From d9b236ce1a5b71d9b0c7a21bb317c0a658be8a64 Mon Sep 17 00:00:00 2001 From: GPlay97 Date: Thu, 24 Oct 2019 19:34:05 +0200 Subject: [PATCH 2/2] fix cmd --- cars/KONA_EV.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cars/KONA_EV.py b/cars/KONA_EV.py index f76fc2a..18ce0d9 100644 --- a/cars/KONA_EV.py +++ b/cars/KONA_EV.py @@ -38,10 +38,10 @@ def getData(self): if 0x7EC22 in raw[220101] else None, 'batteryMinTemperature': int.from_bytes(raw[220101][0x7EC22][5:6], byteorder='big', signed=True) \ if 0x7EC22 in raw[220101] else None, - 'cumulativeEnergyCharged': int.from_bytes(raw[2101][0x7EC26][0:4], byteorder='big', signed=False) / 10.0 \ - if 0x7EC26 in raw[2101] else None, - 'cumulativeEnergyDischarged': int.from_bytes(raw[2101][0x7EC26][4:7] + raw[2101][0x7EC27][0:1], byteorder='big', signed=False) / 10.0 \ - if 0x7EC26 in raw[2101] and 0x7EC27 in raw[2101] else None, + 'cumulativeEnergyCharged': int.from_bytes(raw[220101][0x7EC26][0:4], byteorder='big', signed=False) / 10.0 \ + if 0x7EC26 in raw[220101] else None, + 'cumulativeEnergyDischarged': int.from_bytes(raw[220101][0x7EC26][4:7] + raw[220101][0x7EC27][0:1], byteorder='big', signed=False) / 10.0 \ + if 0x7EC26 in raw[220101] and 0x7EC27 in raw[220101] else None, 'charging': 1 if chargingBits & 0xc == 0x8 else 0, 'normalChargePort': 1 if normalChargeBit and normalChargePort else 0, 'rapidChargePort': 1 if normalChargeBit and not normalChargePort else 0,