void HandleWebCmds()
{
  char SetToStr[ ] = " set to: ";
   // Handle any HTTP connections.
  YunClient client = server.accept();
  if (client) {
    // Read the command and value.
    String command = client.readStringUntil('/');
    unsigned long value = client.parseInt();
    // Update state appropriately.
    if (command == UserRed_Str) {
      UserColor.red = constrain(value, 0, 255);
      EEPROM.put( 200, UserColor.red);
      client.print(command); 
      client.print(SetToStr); 
      client.print(UserColor.red);
      client.println();
    }
    else if (command == UserGreen_Str) {
      UserColor.green = constrain(value, 0, 255);
      EEPROM.put( 208, UserColor.green);
            client.print(command); 
      client.print(SetToStr); 
      client.print(UserColor.green);
      client.println();
    }
    else if (command == UserBlue_Str) {
      UserColor.blue = constrain(value, 0, 255);
      EEPROM.put( 216, UserColor.blue);
            client.print(command); 
      client.print(SetToStr); 
      client.print(UserColor.blue);
      client.println();
    }
    else if (command == NightRed_Str) {
      NightLightColor.red = constrain(value, 0, 255);
      EEPROM.put( 224, NightLightColor.red);
            client.print(command); 
      client.print(SetToStr); 
      client.print(NightLightColor.red);
      client.println();
    }
    else if (command == NightGreen_Str) {
      NightLightColor.green = constrain(value, 0, 255);
      EEPROM.put( 232, NightLightColor.green);
            client.print(command); 
      client.print(SetToStr); 
      client.print(NightLightColor.green);
      client.println();
    }
    else if (command == NightBlue_Str) {
      NightLightColor.blue = constrain(value, 0, 255);
      EEPROM.put( 240, NightLightColor.blue);
            client.print(command); 
      client.print(SetToStr); 
      client.print(NightLightColor.blue);
      client.println();
    }
        else if (command == AlarmRed_Str) {
      AlarmColor.red = constrain(value, 0, 255);
      EEPROM.put( 248, AlarmColor.red);
            client.print(command); 
      client.print(SetToStr); 
      client.print(AlarmColor.red);
      client.println();
    }
    else if (command == AlarmGreen_Str) {
      AlarmColor.green = constrain(value, 0, 255);
      EEPROM.put( 256, AlarmColor.green);
            client.print(command); 
      client.print(SetToStr); 
      client.print(AlarmColor.green);
      client.println();
    }
    else if (command == AlarmBlue_Str) {
      AlarmColor.blue = constrain(value, 0, 255);
      EEPROM.put( 264, AlarmColor.blue);
            client.print(command); 
      client.print(SetToStr); 
      client.print(AlarmColor.blue);
      client.println();
    }
    else if (command == Button1_Str) {
      SW1State = constrain(value, 0, 255);
      client.print(command); 
      client.print(SetToStr); 
      client.print(UserColor.red);
      client.println();
    }
    else if (command == Button2_Str) {
      SW2State = constrain(value, 0, 255);
            client.print(command); 
      client.print(SetToStr); 
      client.print(SW2State);
      client.println();
    }
    else if (command == DayTime_SOD_Str) {
      DayTime_SOD =  constrain(value, 0, 86400);
       EEPROM.put(272, DayTime_SOD);
      client.print(command); 
      client.print(SetToStr); 
      client.print(DayTime_SOD);
      client.println();
    }
    else if (command == NightTime_SOD_Str) {
      NightTime_SOD =  constrain(value, 0, 86400);
      EEPROM.put(280, NightTime_SOD);    
      client.print(command); 
      client.print(SetToStr); 
      client.print(NightTime_SOD);
      client.println();  
    }
    else if (command == MaxDayUserOnTime_SOD_Str) {
      MaxDayUserOnTime_SOD =  constrain(value, 0, 86400);
       EEPROM.put(88, MaxDayUserOnTime_SOD);
                    client.print(command); 
      client.print(SetToStr); 
      client.print(MaxDayUserOnTime_SOD);
      client.println();
    }
    else if (command == MaxNightUserOnTime_SOD_Str) {
      MaxNightUserOnTime_SOD =  constrain(value, 0, 86400);
      EEPROM.put(96, MaxNightUserOnTime_SOD);
      client.print(command); 
      client.print(SetToStr); 
      client.print(MaxNightUserOnTime_SOD);
      client.println();
    }
    else if (command == UserFadeUp_s_Str) {
      UserFadeUp_s =  constrain(value, 0, 86400);
      EEPROM.put(104, UserFadeUp_s);
            client.print(command); 
      client.print(SetToStr); 
      client.print(UserFadeUp_s);
      client.println();
    }
    else if (command == AutoFadeDown_s_Str) {
      AutoFadeDown_s =  constrain(value, 0, 86400);
      EEPROM.put(112, AutoFadeDown_s);
      client.print(command); 
      client.print(SetToStr); 
      client.print(AutoFadeDown_s);
      client.println();
    }    
    else if (command == WeekdayAlarm_SOD_Str) {
      WeekdayAlarm_SOD =  constrain(value, 0, 86400);
      EEPROM.put(120, WeekdayAlarm_SOD);
      client.print(command); 
      client.print(SetToStr); 
      client.print(WeekdayAlarm_SOD);
      client.println();
    }    
    else if (command == WeekendAlarm_SOD_Str) {
      WeekendAlarm_SOD =  constrain(value, 0, 86400);
       EEPROM.put(128, WeekendAlarm_SOD);
       client.print(command); 
      client.print(SetToStr); 
      client.print(WeekendAlarm_SOD);
      client.println();
    }      
    else if (command == AlarmFadeUpTime_s_Str) {
      AlarmFadeUpTime_s =  constrain(value, 0, 86400);
       EEPROM.put(136, AlarmFadeUpTime_s); 
       client.print(command); 
      client.print(SetToStr); 
      client.print(AlarmFadeUpTime_s);
      client.println();
    }
    else if (command == AlarmAutoOffTime_s_Str) {
      AlarmAutoOffTime_s =  constrain(value, 0, 86400);
        EEPROM.put(144, AlarmAutoOffTime_s);
        client.print(command); 
      client.print(SetToStr); 
      client.print(AlarmAutoOffTime_s);
      client.println();
    }
        else if (command == DayModeMaxBrightness_Percent_Str) {
      DayModeMaxBrightness_Percent =  constrain(value, 0, 255);
        EEPROM.put(152, DayModeMaxBrightness_Percent);
        client.print(command); 
      client.print(SetToStr); 
      client.print(DayModeMaxBrightness_Percent);
      client.println();
    }
        else if (command == NightModeMaxBrightness_Percent_Str) {
      NightModeMaxBrightness_Percent =  constrain(value, 0, 255);
        EEPROM.put(160, NightModeMaxBrightness_Percent);
        client.print(command); 
      client.print(SetToStr); 
      client.print(NightModeMaxBrightness_Percent);
      client.println();
    }
        else if (command == NightModeMinBrightness_Percent_Str) {
      NightModeMinBrightness_Percent =  constrain(value, 0, 255);
        EEPROM.put(168, NightModeMinBrightness_Percent);
        client.print(command); 
      client.print(SetToStr); 
      client.print(NightModeMinBrightness_Percent);
      client.println();
    }
            else if (command == IsAlarm1On_Str) {
      IsAlarm1On =  constrain(value, 0, 255);
        EEPROM.put(176, IsAlarm1On);
        client.print(command); 
      client.print(SetToStr); 
      client.print(IsAlarm1On);
      client.println();
    }
    else if (command == IsAlarm2On_Str) {
      IsAlarm2On =  constrain(value, 0, 255);
        EEPROM.put(184, IsAlarm2On);
        client.print(command); 
      client.print(SetToStr); 
      client.print(IsAlarm2On);
      client.println();
    }
      else if (command == Diag_Str) {
      ProgramDiagnostics =  constrain(value, 0, 255);
      EEPROM.put(192, ProgramDiagnostics);
      client.print(command); 
      client.print(SetToStr); 
      client.print(ProgramDiagnostics);
      client.println();
    }
    else if (command == PartyMode_Str) {
      PartyMode =  constrain(value, 0, 1);
    }
    
    else {
      client.print(Invalid_Str);
      client.println();
    }
// Reply with Current Settings
    client.println();
    client.print("Current Setings:");
    client.println();
    // User Red   
     client.print(UserRed_Str);
     client.print(colon_Str);     
     client.print(UserColor.red);
     // User Green
     client.print(Tab_Str);   
     client.print(UserGreen_Str);
     client.print(colon_Str);     
     client.print(UserColor.green);
     // User Blue
     client.print(Tab_Str);   
     client.print(UserBlue_Str);
     client.print(colon_Str);     
     client.print(UserColor.blue);
     client.println();
     
     // NightLightColor Red   
     client.print(NightRed_Str);
     client.print(colon_Str);     
     client.print(NightLightColor.red);
     // NightLightColor Green
     client.print(Tab_Str);   
     client.print(NightGreen_Str);
     client.print(colon_Str);     
     client.print(NightLightColor.green);
     // NightLightColor Blue
     client.print(Tab_Str);   
     client.print(NightBlue_Str);
     client.print(colon_Str);     
     client.print(NightLightColor.blue);
     client.println();

     // AlarmColor Red   
     client.print(AlarmRed_Str);
     client.print(colon_Str);     
     client.print(AlarmColor.red);
     // AlarmColor Green
     client.print(Tab_Str);   
     client.print(AlarmGreen_Str);
     client.print(colon_Str);     
     client.print(AlarmColor.green);
     // AlarmColor Blue
     client.print(Tab_Str);   
     client.print(AlarmBlue_Str);
     client.print(colon_Str);     
     client.print(AlarmColor.blue);
     client.println();

     // User Variables  
       client.print(DayOfWeek_Str);
       client.print(colon_Str);
       client.print(DayofWeek);
       client.println();
       
       client.print(Network_SOD_Str);
       client.print(colon_Str);
       client.print(Network_SOD);         
       client.println();
      
       client.print(Current_SOD_Str);
       client.print(colon_Str);
       client.print(CurrentTime_SOD);         
       client.println();  
      

       client.print(DayTime_SOD_Str);
       client.print(colon_Str);
       client.print(DayTime_SOD);         
       client.println();  
       
       client.print(NightTime_SOD_Str);
       client.print(colon_Str);
       client.print(NightTime_SOD);         
       client.println();       
       
       client.print(MaxDayUserOnTime_SOD_Str);
       client.print(colon_Str);
       client.print(MaxDayUserOnTime_SOD);         
       client.println();  
       client.print(MaxNightUserOnTime_SOD_Str);
       client.print(colon_Str);
       client.print(MaxNightUserOnTime_SOD);         
       client.println(); 
       client.print(UserFadeUp_s_Str);
       client.print(colon_Str);
       client.print(UserFadeUp_s);         
       client.println();        
       client.print(AutoFadeDown_s_Str);
       client.print(colon_Str);
       client.print(AutoFadeDown_s);         
       client.println();  
       client.print(WeekdayAlarm_SOD_Str);
       client.print(colon_Str);
       client.print(WeekdayAlarm_SOD);         
       client.println(); 
       client.print(WeekendAlarm_SOD_Str);
       client.print(colon_Str);
       client.print(WeekendAlarm_SOD);         
       client.println();        
       client.print(AlarmFadeUpTime_s_Str);
       client.print(colon_Str);
       client.print(AlarmFadeUpTime_s);         
       client.println();  
       client.print(AlarmAutoOffTime_s_Str);
       client.print(colon_Str);
       client.print(AlarmAutoOffTime_s);         
       client.println();        
       client.print(DayModeMaxBrightness_Percent_Str);
       client.print(colon_Str);
       client.print(DayModeMaxBrightness_Percent);         
       client.println();  
       client.print(NightModeMaxBrightness_Percent_Str);
       client.print(colon_Str);
       client.print(NightModeMaxBrightness_Percent);         
       client.println(); 
       client.print(NightModeMinBrightness_Percent_Str);
       client.print(colon_Str);
       client.print(NightModeMinBrightness_Percent);         
       client.println(); 
       
       client.print(IsAlarm1On_Str);
       client.print(colon_Str);
       client.print(IsAlarm1On);         
       client.println(); 
       
       client.print(IsAlarm2On_Str);
       client.print(colon_Str);
       client.print(IsAlarm2On);         
       client.println();
       
       client.print(Diag_Str);
       client.print(colon_Str);
       client.print(ProgramDiagnostics);         
       client.println(); 
       
       client.print(PartyMode_Str);
       client.print(colon_Str);
       client.print(PartyMode);         
       client.println();
        client.stop();
  }   
}

