gboudreau / nissan-connect-php

Use the Nissan Connect (was Carwings) API using a simple PHP class.
GNU General Public License v3.0
38 stars 17 forks source link

Added lockDoors for Gen2 Models + Typo Fix to avoid errors. #27

Closed Raiden38 closed 5 years ago

Raiden38 commented 5 years ago

I think the file I use is different, so instead of pasting the whole file, here is the changes I made: Can you please add it to the new-api?

/**
 * Lock Car Door.
 *
 * @param int $pin Requires a 4 digit security PIN as configured in the Nissan Connect App
 * @param bool $waitForResult Should we wait until the command result is known, before returning? Enabling this will wait until the car executed the command, and returned the response, which can sometimes take a few minutes. @deprecated
 *
 * @return stdClass
 * @throws Exception
 */
public function lockDoor($pin = 0000, $waitForResult = FALSE) {
    $this->prepare();
    $params["remoteRequest"]["authorizationKey"] = $pin;
    $result = $this->sendRequest("remote/vehicles/{$this->config->vin}/accounts/{$this->config->accountID}/rdl/createRDL", $params);
    return $result;
}
gboudreau commented 5 years ago

Can you unlock doors too, using /rdl/createRUDL ?

Raiden38 commented 5 years ago

Yes, it would work but I don't want to add it, for security reasons! :)

gboudreau commented 5 years ago

Merged into new-api branch at https://github.com/gboudreau/nissan-connect-php/tree/new-api