public function setRGB($red, $green, $blue)
{
$x = new SetLightState($this);
$y = $x->rgb((int) $red, (int) $green, (int) $blue);
$this->client->sendCommand($y);
// Change internal xy, brightness and colormode state
$xy = ColorConversion::convertRGBToXY($red, $green, $blue);
$this->attributes->state->xy = array($xy['x'], $xy['y']);
$this->attributes->state->bri = $xy['bri'];
$this->attributes->state->colormode = 'xy';
return $this;
}