 
 /**
  * @brief Event handler for when a connection to the MQTT has been established.
- */
-void onMQTTConnect() {
+ *
+ * @param bool sessionPresent
+ */
+void onMQTTConnect(bool sessionPresent) {
   DEBUGLOG("[MQTT] Connected\n");
 
   // Notify subscribers (connected)

 * @brief Bootstrap function for the MQTT connection
 */
void setupMQTT() {
  mqtt.onConnect([](bool sessionPresent) { onMQTTConnect(); });

  mqtt.onDisconnect(
      [](AsyncMqttClientDisconnectReason reason) { onMQTTDisconnect(); });

  mqtt.onMessage([](char *topic, char *payload,
                    AsyncMqttClientMessageProperties properties, size_t len,
                    size_t index,
                    size_t total) { onMQTTMessage(topic, payload, len); });
}

/**

 * @brief Event handler for when the connection to the MQTT broker has been
 * disconnected.
 */
void onMQTTDisconnect(AsyncMqttClientDisconnectReason reason) {
  DEBUGLOG("[MQTT] Disconnected. Reason: %d\n", reason);

  // Notify subscribers (disconnected)
  for (uint8_t i = 0; i < _mqtt_callbacks.size(); i++) {
