       return request->send( response );
     }
 
-    else if ( request->hasArg( "minimum" ) )
-    {
+    else if ( request->hasArg( "minimum" ) ) {
       float minLevel = request->arg( "minimum" ).toFloat();
-      if ( minLevel < 0 || minLevel > 0.991 )
-      {
+      if ( minLevel < 0 || minLevel > 0.991 ) {
         return request->send( 400, HEADER_HTML, "Invalid level" );
       }
       channel[ channelNumber ].minimumLevel = minLevel;

      return request->send( response );
    }

    else
    {
      return request->send( 400, HEADER_HTML, "Invalid option" );
    }
  });

  server.on( "/api/setdevice", HTTP_POST, []( AsyncWebServerRequest * request )
  {
    if ( !request->authenticate( WWW_USERNAME, preferences.getString( PASSWD_KEY_NVS, WWW_DEFAULT_PASSWD ).c_str() ) )
    {
      return request->requestAuthentication();
    }

    if ( request->hasArg( "clearnvs" ) )
    {
      preferences.clear();
      return request->send( 200, HEADER_HTML, "NVS cleared" );
    }

    if ( request->hasArg( "clearwifi" ) )
    {
      request->send( 200, HEADER_HTML, "WiFi data erased" );
      WiFi.disconnect(true);
      return;
    }

    else if ( request->hasArg( "hostname" ) )
    {
      if ( !setupMDNS( request->arg( "hostname" ).c_str() ) )
      {
        char wrongName[81];
        snprintf( wrongName , sizeof( wrongName ), "ERROR: %s is already present.", request->arg( "hostname" ).c_str() );
        return request->send( 400, HEADER_HTML, wrongName );


#define INVALID_CHANNEL 100

void webServerTask ( void * pvParameters ) {
  static const char * WWW_USERNAME             = "admin";
  static const char * WWW_DEFAULT_PASSWD       = "esp32";

