nuki-rs 0.2.3

a rust implmentation for BLE API for Nuki Smart Lock
Documentation

nuki-rs

Crates.io Version docs.rs Crates.io License Crates.io Total Downloads

Bluetooth API for Nuki Smartlock

Usage

Pair

let mut nuki = NukiSmartLock::discover_pairable().await.unwrap();
nuki.pair("TestUser").await.unwrap();

// Save the credentials to file.
// The file contains the MAC adresse and the private key. 
nuki.save(&String::from("nuki-credentials.json")).unwrap();

Perform actions

The following actions can be performed: Perform one of the following actions:

  • Unlock,
  • Lock,
  • Unlatch,
  • LockAndGo,
  • LockAnGoUnlatch,
  • FullLock,
  • FobAction1,
  • FobAction2,
  • FobAction3
// Perfom unlock
use nuki_command::LockAction;

let nuki = NukiSmartLock::load(&String::from("nuki-credentials.json")).unwrap();
nuki.perform_lock_action(LockAction::Unlock, "TestUser").unwrap();

Example

see /example.