From 2bfb4ce33ed0b721439c2b49d7327afefb97705f Mon Sep 17 00:00:00 2001 From: Julien <6372605+fetzu@users.noreply.github.com> Date: Sat, 21 Oct 2023 10:39:45 +0200 Subject: [PATCH] (re-)fix: processing error when transitioning out of charging ~ Turns out there was a way more simple (and working...) way to do this :sweat: --- teslamate_mqtt2abrp.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/teslamate_mqtt2abrp.py b/teslamate_mqtt2abrp.py index a914155..4e3e934 100644 --- a/teslamate_mqtt2abrp.py +++ b/teslamate_mqtt2abrp.py @@ -216,8 +216,7 @@ def on_message(client, userdata, message): elif topic_postfix == "charge_energy_added": data["kwh_charged"] = float(payload) elif topic_postfix == "charger_phases": - payload = payload.decode('utf-8') #Fixes processing error when transitioning out of charging - charger_phases = 3 if int(payload) > 1 else 1 + charger_phases = 3 if payload and int(payload) > 1 else 1 #Fixes processing error when transitioning out of charging elif topic_postfix == "inside_temp": a=0 #Volontarely ignored elif topic_postfix == "since":