Skip to content

Commit d60b281

Browse files
authored
feat: wolock example (#211)
1 parent 3412559 commit d60b281

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,29 @@ Using the script `scripts/get_encryption_key.py` you can manually obtain locks e
66

77
Usage:
88
```shell
9-
python3 get_encryption_key.py MAC USERNAME
9+
$ python3 get_encryption_key.py MAC USERNAME
10+
Key ID: xx
11+
Encryption key: xxxxxxxxxxxxxxxx
1012
```
13+
1114
Where `MAC` is MAC address of the lock and `USERNAME` is your SwitchBot account username, after that script will ask for your password.
1215
If authentication succeeds then script should output your key id and encryption key.
1316

17+
Examples:
18+
19+
* WoLock
20+
21+
```python
22+
import asyncio
23+
from switchbot.discovery import GetSwitchbotDevices
24+
from switchbot.devices import lock
25+
1426

27+
async def main():
28+
wolock = await GetSwitchbotDevices().get_locks()
29+
await lock.SwitchbotLock(wolock['32C0F607-18B8-xxxx-xxxx-xxxxxxxxxx'].device, "key-id", "encryption-key").get_lock_status()
30+
31+
32+
asyncio.run(main())
33+
34+
```

0 commit comments

Comments
 (0)