 void loop()
 {
   #ifdef DEBUG_SWITCHER
-    Serial.println(".");
+    //Serial.println(".");
   #endif
-  
-  // get buttons states from OpenHAB API
-  if ( more_than_4000_millis_passed() && api_available() )
-  {
-    for (int i=0; i<buttons_count; i++) {
-      int api_button_state = read_button_state_from_api( i+1 );
-      toggle_button_led( i+1, api_button_state);
-      buttons_state[i] = api_button_state;
-    }
-  }
   
   // send request to API if button pressed
   for (int i=0; i<buttons_count; i++) {

void setup()
{ 
  pinMode(main_led_pin, OUTPUT);
  digitalWrite( main_led_pin, HIGH );
  delay(2000);
  digitalWrite( main_led_pin, LOW );

  #ifdef DEBUG_SWITCHER
    Serial.begin(9600);
    Serial.println("connect to network");
  #endif

 setup_buttons();
 sturtup_blink();
 byte mac[] = { 0x9C, 0x92, 0x27, 0x2D, 0xDA, 0x93 };

  return status_code;
}

char lights_url_by_button_number(int button_number)
{  
  return (char)(((int)'0') + button_number);
}

int api_available()
