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")
@ -137,4 +137,4 @@ while True:
print("Set Time:", current_time)
set_time(current_time[3], current_time[4])
time.sleep(1)
time.sleep(1)