public function setLights($selector = 'all', $state = 'on', $duration = 1.0)
    {
        $request = new Request('PUT', 'lights/' . $selector . '/state');
        $response = $this->sendRequest($request, [
            'query' => [
                'power' => $state,
                'duration' => $duration
            ]
        ]);

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

        return $response->getBody();
    }
public function setLights ( $ selector = 'all' , $ state = 'on' , $ duration = 1.0 ) { $ request = new Request ( 'PUT' , 'lights/' . $ selector . '/state' ) ; $ response = $ this -> sendRequest ( $ request , [ 'query' => [ 'power' => $ state , 'duration' => $ duration ] ] ) ; return $ response -> getBody ( ) ; }
Turn lights on or off.

@param string $selector Selector used to filter lights. Defaults to `all`.
@param string $state State of 'on' or 'off'.
@param float $duration (Optional) Fade to the given `state` over a duration of seconds. Defaults to `1.0`.
@return \Psr\Http\Message\StreamInterface
Turn lights on or off .