From 40f81b105f8b9897015be1f69888e6d54fa7b54f Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 19 Mar 2023 12:56:31 +0100 Subject: [PATCH] Set the connected flag when connecting/disconnecting from a service. --- platypush/plugins/bluetooth/_legacy/_manager/_base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platypush/plugins/bluetooth/_legacy/_manager/_base.py b/platypush/plugins/bluetooth/_legacy/_manager/_base.py index 12bf4eddd..8672fbac9 100644 --- a/platypush/plugins/bluetooth/_legacy/_manager/_base.py +++ b/platypush/plugins/bluetooth/_legacy/_manager/_base.py @@ -174,6 +174,7 @@ class LegacyManager(BaseBluetoothManager): raise AssertionError(f'Connection to {device} timed out') from e dev.connected = True + conn.service.connected = True self.notify(BluetoothDeviceConnectedEvent, dev) yield conn @@ -183,6 +184,7 @@ class LegacyManager(BaseBluetoothManager): self._connections.pop(conn.key, None) dev.connected = False + conn.service.connected = False self.notify(BluetoothDeviceDisconnectedEvent, dev) @override