From f6675a3bebfe6ac6d2b680de9ed55b7bdb676729 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 28 Nov 2023 07:29:41 -0600 Subject: [PATCH] Raise BluetoothConnectionDroppedError if connection drops during GATT read/write --- aioesphomeapi/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aioesphomeapi/client.py b/aioesphomeapi/client.py index 5312775..07db64d 100644 --- a/aioesphomeapi/client.py +++ b/aioesphomeapi/client.py @@ -460,8 +460,9 @@ class APIClient: ), ) if ( - type(msg) is BluetoothDeviceConnectionResponse - ): # pylint: disable=unidiomatic-typecheck + type(msg) # pylint: disable=unidiomatic-typecheck + is BluetoothDeviceConnectionResponse + ): return msg.address == address return msg.address == address and msg.handle == handle