public function setColor($selector = 'all', $color = 'white', $duration = 1.0, $power_on = true)
    {
        $request = new Request('PUT', 'lights/' . $selector . '/state');
        $response = $this->sendRequest($request, [
            'query' => [
                'color' => $color,
                'duration' => $duration,
                'power_on' => $power_on,
            ]
        ]);

        return $response->getBody();
    }
public function setColor($selector = 'all', $color = 'white', $duration = 1.0, $power_on = true)
    {
        $request = new Request('PUT', 'lights/' . $selector . '/state');
        $response = $this->sendRequest($request, [
            'query' => [
                'color' => $color,
                'duration' => $duration,
                'power_on' => $power_on,
            ]
        ]);

        return $response->getBody();
    }
public function setColor ( $ selector = 'all' , $ color = 'white' , $ duration = 1.0 , $ power_on = true ) { $ request = new Request ( 'PUT' , 'lights/' . $ selector . '/state' ) ; $ response = $ this -> sendRequest ( $ request , [ 'query' => [ 'color' => $ color , 'duration' => $ duration , 'power_on' => $ power_on , ] ] ) ; return $ response -> getBody ( ) ; }
Set lights to any color.

@param string $selector Selector used to filter lights. Defaults to `all`.
@param string $color Color the lights should be set to. Defaults to `white`.
@param float $duration (Optional) Fade to the given `state` over a duration of seconds. Defaults to `1.0`.
@param bool $power_on (Optional) Whether to turn light on first. Defaults to `true`.
@return \Psr\Http\Message\StreamInterface
Set lights to any color .