BLE library for the BlueRetro retro-console Bluetooth adapter
Project description
blueretro-ble
Pure-Python BLE library for the BlueRetro
retro-console Bluetooth adapter. Talks to the BlueRetro GATT server via
bleak +
bleak-retry-connector
(connect → read/write → disconnect).
Powers the BlueRetro Home Assistant integration.
Install
pip install blueretro-ble
Usage
from blueretro_ble import BlueRetroDevice, supports
# `supports(advertisement)` is a discovery predicate: True if a BLE
# advertisement (anything exposing `.name` and `.service_uuids`) looks
# like a BlueRetro adapter.
device = BlueRetroDevice()
state = await device.async_update(ble_device) # a bleak BLEDevice
print(state.fw_version, state.game_id, state.game_name)
await device.async_reboot(ble_device)
await device.async_deep_sleep(ble_device)
async_update connects, reads ABI/firmware/BD-address directly, runs two
command-then-read cycles (game id, config source), resolves the game name from
the bundled gameid.db, always disconnects, and never raises — on failure it
returns a BlueRetroState(available=False).
Notes
- The adapter only accepts connections while idle (no controller connected).
During gameplay, connections fail and
async_updatereturns an unavailable state. gameid.dbis a SQLite database (games(id TEXT, name TEXT)) bundled with the package, sourced fromdarthcloud/BlueRetroWebCfg.- The BLE protocol is reverse-engineered from the official web config; verify
cfg_src(0x05) against real hardware.
Development
python -m venv .venv && . .venv/bin/activate
pip install -e ".[test]"
pytest
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blueretro_ble-0.1.1.tar.gz.
File metadata
- Download URL: blueretro_ble-0.1.1.tar.gz
- Upload date:
- Size: 268.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cca9583b9f3587d718eb4d6a598921693129916d511b9f4f5214dec5175fd5bb
|
|
| MD5 |
d2d52f18718daa27d8607207b57d0ad8
|
|
| BLAKE2b-256 |
7cb6366ee29de43c44c0d9c1b5b2eab1ba76a93c652f5d6e6c8d5c0a8f1fbb40
|
Provenance
The following attestation bundles were made for blueretro_ble-0.1.1.tar.gz:
Publisher:
release.yml on hudsonbrendon/blueretro-ble
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blueretro_ble-0.1.1.tar.gz -
Subject digest:
cca9583b9f3587d718eb4d6a598921693129916d511b9f4f5214dec5175fd5bb - Sigstore transparency entry: 1630853355
- Sigstore integration time:
-
Permalink:
hudsonbrendon/blueretro-ble@9c823efbd53f50425eef2f49550c223367866211 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/hudsonbrendon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9c823efbd53f50425eef2f49550c223367866211 -
Trigger Event:
push
-
Statement type:
File details
Details for the file blueretro_ble-0.1.1-py3-none-any.whl.
File metadata
- Download URL: blueretro_ble-0.1.1-py3-none-any.whl
- Upload date:
- Size: 269.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d227f587a0041e3529107833992509fd6cd2768e80a4cad520b4d9d683ddb04
|
|
| MD5 |
de371d9118a5a0e9bf659400c3447228
|
|
| BLAKE2b-256 |
2819cf3dbdf2cc5cf2ab1a2250020f48b5f0dbf36a911d2ccf8db60251782be3
|
Provenance
The following attestation bundles were made for blueretro_ble-0.1.1-py3-none-any.whl:
Publisher:
release.yml on hudsonbrendon/blueretro-ble
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blueretro_ble-0.1.1-py3-none-any.whl -
Subject digest:
9d227f587a0041e3529107833992509fd6cd2768e80a4cad520b4d9d683ddb04 - Sigstore transparency entry: 1630853462
- Sigstore integration time:
-
Permalink:
hudsonbrendon/blueretro-ble@9c823efbd53f50425eef2f49550c223367866211 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/hudsonbrendon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9c823efbd53f50425eef2f49550c223367866211 -
Trigger Event:
push
-
Statement type: