use blue led to indicate mqtt connectivity

This commit is contained in:
Nicu Hodos 2024-05-18 09:45:17 +02:00
parent 96b420b258
commit 186678cffc

View File

@ -55,10 +55,12 @@ namespace Mqtt {
client.subscribe(mainTopic, 0);
tReConnect.disable();
Serial.println("Connected to MQTT");
turnLed(BLUE_LED, false);
});
client.onDisconnect([](AsyncMqttClientDisconnectReason reason) {
tReConnect.enableDelayed();
Serial.println("Disconnected from MQTT");
turnLed(BLUE_LED);
});
client.onMessage(onMessage);
client.setServer(MQTT_HOST, MQTT_PORT);