Skip to content

Commit 273f3bc

Browse files
author
JacobAndrewSmith92
authored
feat(lock-status): Added reference docs and batch mapping (#124)
updated docs to show the function and the return values of the lock_status method updated the map dict to map the security endpoint to lock_status when using batch
1 parent f8ba40c commit 273f3bc

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

REFERENCE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,25 @@ Returns the `Permissions` NamedTuple, paged list of all permissions currently as
467467
| `Permissions.unit_system` | String[] | An array of permission |
468468
| `Permissions.meta` | collections.namedtuple | Smartcar response headers (`request_id`, `data_age`, and/or `unit_system`) |
469469

470+
---
471+
472+
### `lock_status(self)`
473+
474+
Returns the lock status for a vehicle and the open status of its doors, windows, storage units, sunroof and charging port where available. The open status array(s) will be empty if a vehicle has partial support. The request will error if lock status can not be retrieved from the vehicle or the brand is not supported.
475+
476+
#### Return
477+
478+
| Value | Type | Description |
479+
|:--------------------------|:-----------------------|:---------------------------------------------------------------------------|
480+
| `isLocked` | bool | Indicates whether the vehicle is locked. |
481+
| `doors` | typing.NamedTuple | An array of the open status of the vehicle's doors. Array length will vary depending on the number of doors. |
482+
| `windows` | typing.NamedTuple | An array of the open status of the vehicle's windows. Array length will vary depending on the number of windows. |
483+
| `sunroof` | typing.NamedTuple | An array of the open status of the vehicle's sunroofs. |
484+
| `storage` | typing.NamedTuple | An array of the open status of the vehicle's storages. For internal combustion and plug-in hybrid vehicles, front refers to the engine hood. For battery vehicles, this will be the front trunk. |
485+
| `chargingPort` | typing.NamedTuple | An array of the open status of the vehicle's charging port |
486+
| `LockStatus.meta` | collections.namedtuple | Smartcar response headers (`request_id`, `data_age`, and/or `unit_system`) |
487+
488+
470489
---
471490

472491
### `batch(self, paths)`

smartcar/helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def format_path_and_attribute_for_batch(raw_path: str) -> tuple:
120120
"charge/limit": "get_charge_limit",
121121
"tires/pressure": "tire_pressure",
122122
"": "attributes",
123+
"security": "lock_status",
123124
}
124125
formatted_path = raw_path[1:] if raw_path[0] == "/" else raw_path
125126
formatted_attribute = mapper.get(formatted_path, formatted_path)

0 commit comments

Comments
 (0)