gomalock
Sesame スマートロックを Bluetooth Low Energy で操作する Python ライブラリ。
主な機能
- Sesame 5 / Sesame 5 Pro / Sesame 5 USA の施錠、解錠、トグル操作
- Sesame 5 系の角度、バッテリー残量、オートロック設定の取得と変更
- Sesame Touch / Sesame Touch Pro / Sesame Touch 2 / Sesame Touch 2 Pro のバッテリー残量と登録済みカード、指紋、パスワード数の取得
- 周囲の Sesame デバイスのスキャン
- 新規 Sesame デバイスの登録
- 共有用 QR URL の作成
- 予期しない切断後の自動再接続
インストール
pip install gomalock
最新のソースからインストールする場合:
pip install git+https://github.com/meronepy/gomalock.git
クイックスタート
import asyncio
import gomalock
ADDRESS = "XX:XX:XX:XX:XX:XX"
SECRET_KEY = "0123456789abcdef0123456789abcdef"
async def main():
async with gomalock.Sesame5(ADDRESS, secret_key=SECRET_KEY) as sesame5:
await sesame5.unlock("gomalock")
if __name__ == "__main__":
asyncio.run(main())
ADDRESSは examples/discover.py で周囲の Sesame をスキャンして取得できます。SECRET_KEYは mochipon さん作成の QR Code Reader for SESAME でマネージャー権限以上の QR コードから抽出するか、SESAME Biz から取得できます。- 詳しい使い方は examples と docs を参照してください。
- v1.1.2 以前から移行する場合は v2.0.0 移行ガイド を参照してください。
注意事項
- Raspberry Pi OS では Bluetooth がブロックされていることがあります。
BleakBluetoothNotAvailableErrorが出る場合は、次を試してください。
sudo rfkill unblock bluetooth
- Bluetooth は距離が近いほど安定します。スキャンできない、接続に失敗する、操作だけ失敗する場合は、デバイスとの距離を近づけて試してください。
- Linux では BlueZ 5.82 (Raspberry Pi OS Trixie) 以降 が必要です。
- 履歴機能は公式アプリとの連携が難しいため実装していません。
- 非公式ライブラリです。動作保証はありません。自己責任で使用してください。
開発環境
- Windows 11 24H2, Python 3.13.3
- Raspberry Pi Zero 2W, Raspberry Pi OS Trixie (64bit), Python 3.13.3
- Sesame 5, 3.0-5-ad26ee
- Sesame 5 Pro, 3.0-7-ad26ee
対応機種
| 対応状況 | 機種 |
|---|---|
| ✅ | Sesame 5 |
| ✅ | Sesame 5 Pro |
| ⚠️ | Sesame 5 US (未検証) |
| ❌ | Sesame 4以前 |
| 対応状況 | 機種 |
|---|---|
| ✅ | Sesame Touch |
| ⚠️ | Sesame Touch Pro (未検証) |
| ⚠️ | Sesame Touch 2 (未検証) |
| ⚠️ | Sesame Touch 2 Pro (未検証) |
| ❌ | Sesame Face |
| ❌ | Sesame Face Pro |
対応環境
| 対応状況 | OS |
|---|---|
| ✅ | Windows 11 version 22000 以降 |
| ✅ | Linux with BlueZ 5.82 以降 |
| ⚠️ | macOS 10.15 以降 (未検証) |
Python 3.12 以降が必要です。
Metadata
Release files for gomalock 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gomalock-2.1.0.tar.gz | 26.5 kB | Without provenance | Details for gomalock-2.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gomalock-2.1.0-py3-none-any.whl | Python 3 | none | any | Details for gomalock-2.1.0-py3-none-any.whl |
Total release size: 58.5 kB
Release files / gomalock-2.1.0.tar.gz
| Download URL | gomalock-2.1.0.tar.gz |
|---|---|
| Size | 26.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb038812dbcff3b8d06e70b246ab6e2ee8041f871387343eaedc899217c3a5a7
|
|
BLAKE2b-256 checksum How to use checksums |
a73152e0235c6643be3231eddf34ad67be381e9ad528e31ac8e97cccddec6699
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / gomalock-2.1.0-py3-none-any.whl
| Download URL | gomalock-2.1.0-py3-none-any.whl |
|---|---|
| Size | 32.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ca2094de45c3f8e40d81fc55b2f7771ebafe955a59061bd60e431b359058311
|
|
BLAKE2b-256 checksum How to use checksums |
1320a9f014482842977d12c8d80bb4f1666eefba4c747378d8c79f2859ad809e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for gomalock 2.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.