  */
 void loop() {
   // Ensure connection to MQTT broker is active, if not fix it.
-  if (!g_mqttClient.connected()) {
+  if (WiFi.status() != WL_CONNECTED) {
+    setupWifi();
+  }else if (!g_mqttClient.connected()) {
     reconnect();
   }
 
   // Listen for messages from the broker.
   g_mqttClient.loop();
 
-  // Listen for OTA messages
-  ArduinoOTA.handle();
 
   // Prevent bouncing when performing actions following a read.
   if (millis() - DEBOUNCE_TIME >= DEBOUNCE_DELAY) {

/*
 * Configuration for Home Assistant:
 *   light:
 *   # Interior: Living Room Side Lamp

  // Configure and connect to MQTT broker.
  g_mqttClient.setServer(MQTT_SERVER_IP, MQTT_SERVER_PORT);
  g_mqttClient.setCallback(callback);
}

/*
