 #endif
 
   yield();
-  
+
+#if defined(OTA)
+  handleOTA();
+#endif
+
+  yield();
+
   bulb.loop();
 }

#include <ESP8266WiFi.h>          // https://github.com/esp8266/Arduino
#include <PubSubClient.h>         // https://github.com/knolleary/pubsubclient
#include <ArduinoJson.h>          // https://github.com/bblanchon/ArduinoJson
#include "AI-Thinker_RGBW_Bulb.h"

#if defined(DEBUG_TELNET)
  WiFiServer  telnetServer(23);
  WiFiClient  telnetClient;
  #define     DEBUG_PRINT(x)    telnetClient.print(x)
  #define     DEBUG_PRINTLN(x)  telnetClient.println(x)
#elif defined(DEBUG_SERIAL)
  #define     DEBUG_PRINT(x)    Serial.print(x)
  #define     DEBUG_PRINTLN(x)  Serial.println(x)
#else
  #define     DEBUG_PRINT(x)
  #define     DEBUG_PRINTLN(x)
#endif

AIRGBWBulb    bulb;

  telnetServer.setNoDelay(true);
#endif

#if defined(OTA)
  setupOTA();
#endif

  bulb.init();
}

