0.1.0 • Published 2 years ago

capacitor-oklok-v2 v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

capacitor-oklok-v2

A native plugin used for bluetooth low-energy communication with locks from OKLOK

Install

npm install capacitor-oklok-v2
npx cap sync

API

checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


requestPermissions()

requestPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


request(...)

request(request: Request) => Promise<Return>

Request provided functionalities on the specified lock

ParamTypeDescription
requestRequestoptions object for bluetooth requests

Returns: Promise<Return>


Interfaces

PermissionStatus

PropType
bluetooth"prompt" | "prompt-with-rationale" | "granted" | "denied"
location"prompt" | "prompt-with-rationale" | "granted" | "denied"

Return

PropTypeDescription
isLockedbooleanCurrent status of the lock (Un-/Locked)
batterynumberCurrent percentage of the internal battery of the lock

Request

PropTypeDescription
methodsMethod[]Methods to be executed on the lock
parametersParametersParameters to execute the specified methods

Enums

Method

MembersValue
OPEN'open'
CLOSE'close'
GET_BATTERY'get-battery'
GET_STATUS'get-status'
CHANGE_PASSWORD'change-password'