Skip to main content

PuffcoBLE

Python library for communicating with Puffco devices over Bluetooth Low Energy using the Lorax protocol.

This library allows you to connect to a Puffco device, authenticate, read and write Lorax paths, and control device features such as heat cycles, LEDs, lantern mode, and device information. Everything is async and built on top of bleak.


Features

  • Scan for devices by name or MAC address
  • Automatic Lorax authentication
  • Read and write Lorax paths
  • Typed reads (int, float, bool) and raw byte reads
  • Chunked reads for large data
  • Start, stop, and boost heat cycles
  • Lantern mode control
  • LED brightness control
  • Battery, firmware, uptime, and usage info
  • Fully async / asyncio-based

Requirements

  • Python 3.11+
  • Bluetooth Low Energy capable system

Supported platforms:

  • Windows
  • macOS
  • Linux (BlueZ)

Installation

From PyPI:

pip install PuffcoBLE

From source:

git clone https://github.com/Fr0st3h/PuffcoBLE.git
cd PuffcoBLE
pip install -e .

Basic usage

import asyncio
from puffcoble import PuffcoBLE

async def main():
    device = PuffcoBLE(device_name="DEV PUFFCO", debug=True)
    await device.connect()

    print("Device name:", await device.get_device_name())
    
    #get current profile info
    currentProfile = await device.get_current_profile_name()
    currentProfileTemp = await device.get_current_profile_temp()
    currentProfileDuration = await device.get_current_profile_duration()

    #start heat cycle
    await device.start_heat_cycle()

    #sleep for 3 seconds
    await asyncio.sleep(3)

    #cancel the heat cycle
    await device.stop_heat_cycle()

    #print the current profiles info
    print(f'Current Profile: {currentProfile}, Temperature: {currentProfileTemp}, Duration: {currentProfileDuration} seconds')

    payload = {'lamp': {'name': 'solid', 'param': {'color': ["#b700ff"]}}}


    #sets profile 4 colour
    await device.write_cbor_full("/u/app/hc/3/colr", payload)
    await device.disconnect()

asyncio.run(main())

Connection and authentication

Authentication is handled automatically when calling connect():

  • BLE bonding trigger
  • Access seed request
  • Unlock key generation
  • Lorax access unlock

Manual authentication is not required for normal usage.


Reading data

Typed read:

temp = await puffco.read(
    "/p/app/thc/temp",
    size=4,
    data_type="float32"
)

Raw bytes:

data = await puffco.read("/p/sys/fw/ver", size=12)

Read full path (chunked):

blob = await puffco.read_bytes_all("/p/app/thc/colr")

Writing data

Write raw bytes:

await puffco.write_short(
    "/u/app/ui/lbrt",
    0,
    0,
    bytes([80, 80, 80, 80])
)

Write typed values:

await puffco.write(
    "/p/app/thc/time",
    45.0,
    data_type="float32"
)

Heat cycle control

await puffco.start_heat_cycle()
await puffco.boost_heat_cycle()
await puffco.stop_heat_cycle()

Lantern mode

await puffco.start_lantern()
await puffco.stop_lantern()

Device information

info = await puffco.get_device_info()
serial = await puffco.get_serial_number()
fw = await puffco.get_software_version()
uptime = await puffco.get_uptime()

Debug logging

Enable debug output:

PuffcoBLE(debug=True)

Logging uses Tamga.


Notes

  • This project is not affiliated with Puffco
  • Firmware updates may break compatibility
  • Use at your own risk

License

MIT


Contributing

Pull requests are welcome.
If you add new Lorax paths or opcodes, please document them clearly.

Metadata

Release files for puffcoble 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for puffcoble 0.2.0
File Size Uploaded
puffcoble-0.2.0.tar.gz 12.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for puffcoble 0.2.0
File Interpreter ABI Platform
puffcoble-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.2 kB

Release files / puffcoble-0.2.0.tar.gz

Download URL puffcoble-0.2.0.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
30ecbc2554feace1f0ca97bda86ddd9dcd2aaa871bb7a44ca9aa37798dc9f420
BLAKE2b-256 checksum
How to use checksums
ffe391aba733babdb33b14b07a11234e9910705044d34b4b827c486b8c8412a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 31, 2025.

Transparency log

Release files / puffcoble-0.2.0-py3-none-any.whl

Download URL puffcoble-0.2.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ee6fd29eba455b9ae2cdb716e58e1c3a617eb88cfad847c9ab078923f9ba4c2
BLAKE2b-256 checksum
How to use checksums
28866ff907f14a31c9ba691e15cb500eccd21c8608bf7f5572d2e06849428d4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 31, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page