Skip to content

Commit

Permalink
fix: processing error when transitioning out of charging
Browse files Browse the repository at this point in the history
+ When transitioning out of charging, topic "charger_phases" had an empty byte payload which provoked a processing error; adding a conversion to UTF-8 to avoid the issue
  • Loading branch information
fetzu committed Oct 21, 2023
1 parent 127e10b commit 687e648
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions teslamate_mqtt2abrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +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
elif topic_postfix == "inside_temp":
a=0 #Volontarely ignored
Expand Down

0 comments on commit 687e648

Please sign in to comment.