Skip to content

Commit

Permalink
(re-)fix: processing error when transitioning out of charging
Browse files Browse the repository at this point in the history
~ Turns out there was a way more simple (and working...) way to do this 😓
  • Loading branch information
fetzu committed Oct 21, 2023
1 parent 687e648 commit 2bfb4ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions teslamate_mqtt2abrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit 2bfb4ce

Please sign in to comment.