use cancel_on_disconnection helper

This commit is contained in:
Gilles Boccon-Gibod
2025-06-10 13:28:08 -04:00
parent 39518c89f5
commit 8137caf37b
9 changed files with 43 additions and 66 deletions

View File

@@ -335,7 +335,7 @@ class HearingAccessService(gatt.TemplateService):
# Update the active preset index if needed
await self.notify_active_preset_for_connection(connection)
utils.cancel_on_event(connection, 'disconnection', on_connection_async())
connection.cancel_on_disconnection(on_connection_async())
def _on_read_active_preset_index(self, connection: Connection) -> bytes:
del connection # Unused