-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Raise exception when esphome ble client disconnects during operation #80885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise exception when esphome ble client disconnects during operation #80885
Conversation
Hey there @OttoWinter, @jesserockz, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could cancel the running task instead. Feel like it could be cleaner. I do that in the nibe_heatpump coordinator on unload. Just remember active task on function entry, and cancel any running tasks on disconnect event.
That said, i think this looks okey too.
I'll adjust it to cancel the task if it works out ok in testing |
It will cancel the task, but still raise BleakError to ensure anything looking for BleakError and retrying will still retry to make sure its compatible with existing libraries |
Thanks! |
Heh. Not the way intended. But works too. I meant like:
|
Proposed change
Raise exception when esphome ble client disconnects during operation
Currently we wait for the timeout which means we don't
get retries because we don't know that the ble client disconnected
out from under us which all the other bleak clients do.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: