Skip to content

Commit

Permalink
!chore: bumped paho-mqtt to 2.0.0
Browse files Browse the repository at this point in the history
chore: bump the python-dependencies group with 1 update
chore: handled breaking changes in paho-mqtt 

~ paho-mqtt 1.6.1 -> 2.0.0
~ Upgraded/migrated the callbacks to comply with v2.0.0 of paho-mqtt (https://eclipse.dev/paho/files/paho.mqtt.python/html/migrations.html)
  • Loading branch information
dependabot[bot] authored Feb 11, 2024
1 parent 36cecc2 commit be3bd0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
docopt==0.6.2
requests==2.31.0
paho-mqtt==1.6.1
paho-mqtt==2.0.0
6 changes: 3 additions & 3 deletions teslamate_mqtt2abrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ def niceNow():
logging.debug("Trying to connect to {}:{}".format(MQTTSERVER,MQTTPORT))
client.connect(MQTTSERVER, MQTTPORT)

def on_connect(client, userdata, flags, rc): # The callback for when the client connects to the broker
def on_connect(client, userdata, flags, reason_code, properties): # The callback for when the client connects to the broker
# MQTT Error handling
logging.info("MQTT Connection returned result: {} Code {}.".format(mqtt.connack_string(rc),rc))
if rc != 0:
logging.info("MQTT Connection returned result: {} Code {}.".format(mqtt.connack_string(reason_code),reason_code))
if reason_code != 0:
sys.exit("Could not connect")
client.subscribe(f"teslamate/cars/{CARNUMBER}/#")
if BASETOPIC is not None: client.publish(state_topic, payload="online", qos=2, retain=True)
Expand Down

0 comments on commit be3bd0f

Please sign in to comment.