       }
       analogWrite(LED, 0);
       i = 0;
+
     }
     // Check if the brightness setting has been updated
     else if (strncmp((char *)onoffsw.lastread, "{\"Brightness\":", 14) == 0 ) {
+
       Serial.print(F("Brightness: "));
-
       unsigned int l = strlen((char *)onoffsw.lastread);
       onoffsw.lastread[l - 1] = '\0'; // overwrite the ending bracket
       unsigned int bright_perc = atoi((char *)onoffsw.lastread + 14);


  // Setup MQTT subscription for onoff feed.
  mqtt.subscribe(&onoffsw);
}



        i += 2;
        delay(4);
      }

    }
    else if (strcmp((char *)onoffsw.lastread, "{\"On\":0}") == 0 && led_on) {

      led_on = false;
      Serial.println(F("Off"));
      while (i > 10) {
