Phue\Command\GetNewLights::send PHP Method

send() public method

Send command
public send ( Client $client ) : self
$client Phue\Client Phue Client
return self This object
    public function send(Client $client)
    {
        // Get response
        $response = $client->getTransport()->sendRequest("/api/{$client->getUsername()}/lights/new");
        $this->lastScan = $response->lastscan;
        // Remove scan from response
        unset($response->lastscan);
        // Iterate through left over properties as lights
        foreach ($response as $lightId => $light) {
            $this->lights[$lightId] = $light->name;
        }
        return $this;
    }