Static
ResultSends a command to the device and awaits a response.
The command buffer.
A Promise that resolves with the response buffer.
Connects to the device.
A Promise that resolves when the connection is complete.
Decrypts a buffer using AES-128-CTR.
The data to decrypt.
Disconnects from the device.
A Promise that resolves when the disconnection is complete.
Discovers the device services.
A Promise that resolves with the list of services.
Encrypts a string using AES-128-CTR.
The string to encrypt.
Sends an encrypted command to the device.
The command key.
Retrieves the device characteristics.
A Promise that resolves with the device characteristics.
Retrieves the device name.
A Promise that resolves with the device name.
Retrieves the IV from the device.
Gets general state info from the Smart Lock.
Internal method to handle the connection process.
A Promise that resolves when the connection is complete.
Locks the Smart Lock.
Logs a message with the specified log level.
The severity level of the log (e.g., 'info', 'warn', 'error').
The log message to be emitted.
Operates the lock with the given command.
The command key.
Optional
encrypt: boolean = trueWhether to encrypt the command.
Sets the device name.
The new device name.
A Promise that resolves when the name is set.
Initializes the encryption key info for valid lock communication.
The key ID.
The encryption key.
Unlocks the Smart Lock.
Unlocks the Smart Lock without unlatching the door.
Unsubscribes from the notify characteristic.
A Promise that resolves when the unsubscription is complete.
Static
getStatic
parseParses the service data from the SwitchBot Strip Light.
The service data buffer.
The manufacturer data buffer.
The function to emit log messages.
Static
validate
Class representing a WoSmartLock device.
See
https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/lock.md