API client for the Dog & Bone LockSmart service
Dog & Bone sell a set of Bluetooth LE-enabled padlocks that can be opened with their "LockSmart" app. The app stores and retrieves lock information via an HTTP API, including a random per-lock "password" used for unlocking. This package implements a client for that API.
At the moment this only implements logging in and pulling lock information, as that's all I've needed personally. Adding support for additional endpoints should be pretty simple, and descriptions of all known endpoints can be found in the RESEARCH file. Pull requests very welcome!
npm install --save locksmart-api
const LockSmartApiClient = ;const co = ;;
LockSmartApiClient(apiKey = LOCKSMART_API_DEFAULT_KEY)
API client constructor. Optionally takes an API key; default is the key the Android app uses.
Logs into the LockSmart API service. Returns a promise with users data from the API response. Call this before using other API methods.
Pulls lock information from the LockSmart API server. Returns a promise.
The API key used to authenticate with the LockSmart API server.
The user session token used to authenticate with the LockSmart API server. Present after logging in. It is unknown whether or not this expires.
In addition to
LockSmartApiClient, thhe following constants are exposed from
$ npm lint # checks code style and license compatibility $ npm test # simple test script (requires a LockSmart account)