Phue\Command\CreateRule::send PHP Method

send() public method

Send command
public send ( Client $client ) : integer
$client Phue\Client Phue Client
return integer Rule Id
    public function send(Client $client)
    {
        $response = $client->getTransport()->sendRequest("/api/{$client->getUsername()}/rules", TransportInterface::METHOD_POST, (object) array('name' => $this->name, 'conditions' => array_map(function ($condition) {
            return $condition->export();
        }, $this->conditions), 'actions' => array_map(function ($action) use($client) {
            return $action->getActionableParams($client);
        }, $this->actions)));
        return $response->id;
    }