mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 17:36:15 +00:00
Avoid sending ABRP update without SoC
The ABRP battery prediction algorithm doesn't work when live data is uploaded without State of Charge (soc) field. This commit avoids sending such updates. (cherry picked from commit d8ca85c78b6d02daf825ad183d8128ba8cc9e3e8)
This commit is contained in:
committed by
Florian BEZANNIER
parent
771cf5476c
commit
8b0c625440
@@ -34,6 +34,11 @@ class Abrp:
|
||||
logger.debug("No abrp token provided")
|
||||
elif car.vin in self.abrp_enable_vin:
|
||||
energy = car.status.get_energy('Electric')
|
||||
|
||||
if energy.level is None:
|
||||
logger.debug("No energy level available")
|
||||
return False
|
||||
|
||||
tlm = {"utc": int(datetime.timestamp(energy.updated_at)),
|
||||
"soc": energy.level,
|
||||
"speed": getattr(car.status.kinetic, "speed", None),
|
||||
|
||||
Reference in New Issue
Block a user