pybricks-api icon indicating copy to clipboard operation
pybricks-api copied to clipboard

pybricks.common.BLE: Update type hints and add missing documentation

Open fkleon opened this issue 6 months ago • 0 comments

Hi @laurensvalk and @dlech

I'm implementing the Pybricks BLE interfaces in my pybricks-ble project, and noticed that some of the type hints are inaccurate/incomplete. That makes the type checker unhappy when trying to mimic Pybricks behaviour, but with the changes in this PR I was able to get everything working (see https://github.com/fkleon/pybricks-ble/pull/9).

Update API docs and code completions for the following changes:

  • BLE: Optional broadcast_channel in the hub constructors, and addition of the broadcast_enable() method: https://github.com/pybricks/pybricks-micropython/pull/269 (changed in v3.6.0b2)
  • BLE: broadcast accepts either a single value, a tuple, or a list. observe either returns a single value, or a tuple. (changed in v3.3.0b9)

fkleon avatar Jun 24 '25 12:06 fkleon