add timeout

This commit is contained in:
Fusselkater 2023-04-24 01:20:45 +02:00
parent b2897829cc
commit 20bdbecfce

View file

@ -104,7 +104,7 @@ if not check_wifi_connection():
machine.reset()
# MQTT Setup
mqtt_client = MQTTClient(config.MQTT_ID, config.MQTT_SERVER, config.MQTT_PORT, config.MQTT_USER, config.MQTT_PASSWORD)
mqtt_client = MQTTClient(config.MQTT_ID, config.MQTT_SERVER, config.MQTT_PORT, config.MQTT_USER, config.MQTT_PASSWORD, 30)
mqtt_client.set_callback(mqtt_receive_message)
mqtt_client.connect()
mqtt_client.subscribe(config.MQTT_TOPIC + "/brightness/set")