     
     for (int i = 0; i < 3; i++) {
       token = strtok(NULL, " ");
+      
+      if (strcmp(token, "state") == 0) {
+        getRGBColor();
+        return;
+      }  
+      
       rgb[i] = atoi(token);
     }
     

    int led;
    
    token = strtok(NULL, " ");
    led = atoi(token);
    
    toggleLed(led);
  }
}

void readTemperature() {
  
  float t = dht.readTemperature(); //70.4;
  float h = dht.readHumidity(); //23;
        
  Serial.print("{'temperature': ");
  Serial.print(t);
  Serial.print(", 'humidity': ");
  Serial.print(h);
  Serial.print("}\n");
  
}

void toggleLed(int led) {

 Serial.print("{'status': 'OK'}\n");
}

void getRGBColor() {
  
  int red = 255 - analogRead(redPin);
  int green = 255 - analogRead(greenPin);
  int blue = 255 - analogRead(bluePin);
  
  Serial.print("{'status': 'OK'}");
//  Serial.print("'color': '{'");
//  Serial.print("'red': ");
//  Serial.print(red);
//  Serial.print(", 'green': ");
//  Serial.print(green);
//  Serial.print(", 'blue': ");
//  Serial.print(blue);
//  Serial.print("}}\n");
  
}

int readCommand(char *command) {
    int bufferSize = 0;
    
