diff --git a/doc/readme.md b/doc/readme.md index 5d9f75d..434cfe0 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -628,7 +628,7 @@ Initializes a new Service object to make requests to the Smartcar API. * [.startCharge()](#Vehicle+startCharge) ⇒ [ActionResponse](#ActionResponse) * [.stopCharge()](#Vehicle+stopCharge) ⇒ [ActionResponse](#ActionResponse) * [.disconnect()](#Vehicle+disconnect) ⇒ [ActionResponse](#ActionResponse) - * [.security()](#Vehicle+security) ⇒ [SecurityResponse](#SecurityResponse) + * [.lockStatus()](#Vehicle+lockStatus) ⇒ LockStatus @@ -983,9 +983,9 @@ to make requests to it again. for all possible errors. **See**: [Smartcar API Doc - Disconnect](https://smartcar.com/docs/api#delete-disconnect) - + -### vehicle.security() ⇒ [SecurityResponse](#SecurityResponse) +### vehicle.lockStatus() ⇒ LockStatus Returns the lock status of the vehicle. **Kind**: instance method of [Vehicle](#Vehicle) @@ -995,7 +995,7 @@ Returns the lock status of the vehicle. See the [errors section](https://github.com/smartcar/node-sdk/tree/master/doc#errors) for all possible errors. -**See**: [Smartcar API Doc - Security](https://smartcar.com/docs/api#get-security) +**See**: [Smartcar API Doc - Lock Status](https://smartcar.com/docs/api#get-security) ## METHODS\_MAP : object.<String, Object> diff --git a/lib/smartcar-service.js b/lib/smartcar-service.js index 206d917..7e91b14 100644 --- a/lib/smartcar-service.js +++ b/lib/smartcar-service.js @@ -35,6 +35,7 @@ const getNameFromPath = (path) => { // '/' should have a method name of 'attributes' // '/tires/pressure' should be tirePressure and NOT tiresPressure const BATCH_PATH_TO_ATTRIBUTE = { + '/security': 'lockStatus', '/tires/pressure': 'tirePressure', '/': 'attributes', }; diff --git a/lib/vehicle.js b/lib/vehicle.js index a4ce2cc..6cad6ad 100644 --- a/lib/vehicle.js +++ b/lib/vehicle.js @@ -829,12 +829,12 @@ Vehicle.prototype.request = async function( */ /** - * @name Vehicle#security + * @name Vehicle#lockStatus * @function * @memberof Vehicle * @description Returns the lock status of the vehicle. - * @see {@link https://smartcar.com/docs/api#get-security|Smartcar API Doc - Security} - * @return {SecurityResponse} + * @see {@link https://smartcar.com/docs/api#get-security|Smartcar API Doc - Lock Status} + * @return {LockStatus} * @throws {SmartcarError} - an instance of SmartcarError. * See the [errors section](https://github.com/smartcar/node-sdk/tree/master/doc#errors) * for all possible errors. diff --git a/test/end-to-end/vehicle.js b/test/end-to-end/vehicle.js index 02d7e9d..deb2036 100644 --- a/test/end-to-end/vehicle.js +++ b/test/end-to-end/vehicle.js @@ -399,9 +399,9 @@ test('vehicle batch - security', async(t) => { '/security', ]); - const security = response.security(); + const lockStatus = response.lockStatus(); t.deepEqual( - _.xor(_.keys(security), [ + _.xor(_.keys(lockStatus), [ 'isLocked', 'doors', 'windows',