use new API Version, update python version
This commit is contained in:
parent
2366aa7214
commit
6a176dae0c
|
|
@ -1,4 +1,4 @@
|
|||
FROM python:3.10-slim
|
||||
FROM python:3.12-slim
|
||||
ADD . /code
|
||||
WORKDIR /code
|
||||
RUN pip install --root-user-action ignore -r requirements.txt
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ MQTT_PASSWORD = 'mqtt7355@'
|
|||
MQTT_TOPIC = 'shellies/events/rpc'
|
||||
MQTT_CLIENT_ID = 'MQTT_Logfile_Bridge'
|
||||
|
||||
def on_connect(client, userdata, flags, rc):
|
||||
def on_connect(client, userdata, flags, reason_code, properties):
|
||||
""" The callback for when the client receives a CONNACK response from the server."""
|
||||
print('Connected with result code ' + str(rc))
|
||||
print('Connected with result code ' + reason_code)
|
||||
client.subscribe(MQTT_TOPIC)
|
||||
|
||||
def _parse_mqtt_message(topic, payload):
|
||||
|
|
@ -51,7 +51,7 @@ def on_message(client, userdata, msg):
|
|||
return
|
||||
|
||||
def main():
|
||||
mqtt_client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1,MQTT_CLIENT_ID)
|
||||
mqtt_client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2,MQTT_CLIENT_ID)
|
||||
mqtt_client.username_pw_set(MQTT_USER, MQTT_PASSWORD)
|
||||
mqtt_client.on_connect = on_connect
|
||||
mqtt_client.on_message = on_message
|
||||
|
|
|
|||
Loading…
Reference in New Issue