Skip to content

BPS 0.3.0b3: auto-enable distance sensors for new receivers - #56

Merged
Hogster merged 1 commit into
mainfrom
fix/auto-distance-callback
Nov 25, 2026
Merged

Hogster merged 1 commit into
mainfrom
fix/auto-distance-callback

Conversation

@Hogster

@Hogster Hogster commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Fix

In 0.3.0b2, Turn on new receivers automatically did not work while Home Assistant was running: the entity registry listener lacked @callback, so HA ran it in a worker thread and refused the update (calls entity_registry.async_update_entity from a thread other than the event loop). The sweep at startup worked, so the sensors only came on after the next restart.

Found on a live system: a new receiver (an ESP32 that also controls a car over BLE) heard a second phone for the first time, and that phone's new Distance to … sensor stayed off.

  • distance_sensors.py: the listener is now a @callback.
  • New test: the listener is registered as a callback (fails without the fix).
  • Version 0.3.0b3.

Docs

  • README: HACS is now called the Marketplace in Home Assistant; how to include pre-releases.

Tested

  • 140 unit tests pass.
  • Running on a live HA: the Turn on button turned on all 19 sensors for a newly selected Bermuda device, and the device was placed in the right zone.

🤖 Generated with Claude Code

The entity registry listener lacked @callback, so Home Assistant ran it in a
worker thread, where the registry refuses updates. Sensors for a receiver
added while BPS was running stayed off until the next restart. Adds a test
that the listener is a callback.

README: HACS is now the Marketplace in Home Assistant; how to get betas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Hogster
Hogster merged commit 28f938a into main Nov 25, 2026
8 checks passed
@Hogster
Hogster deleted the fix/auto-distance-callback branch November 25, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant