Repository navigation
BPS 0.3.0b3: auto-enable distance sensors for new receivers - #56
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Docs
Tested
🤖 Generated with Claude Code