forked from platypush/platypush
Set the connected flag when connecting/disconnecting from a service.
This commit is contained in:
parent
9d66b63266
commit
40f81b105f
1 changed files with 2 additions and 0 deletions
|
@ -174,6 +174,7 @@ class LegacyManager(BaseBluetoothManager):
|
||||||
raise AssertionError(f'Connection to {device} timed out') from e
|
raise AssertionError(f'Connection to {device} timed out') from e
|
||||||
|
|
||||||
dev.connected = True
|
dev.connected = True
|
||||||
|
conn.service.connected = True
|
||||||
self.notify(BluetoothDeviceConnectedEvent, dev)
|
self.notify(BluetoothDeviceConnectedEvent, dev)
|
||||||
yield conn
|
yield conn
|
||||||
|
|
||||||
|
@ -183,6 +184,7 @@ class LegacyManager(BaseBluetoothManager):
|
||||||
self._connections.pop(conn.key, None)
|
self._connections.pop(conn.key, None)
|
||||||
|
|
||||||
dev.connected = False
|
dev.connected = False
|
||||||
|
conn.service.connected = False
|
||||||
self.notify(BluetoothDeviceDisconnectedEvent, dev)
|
self.notify(BluetoothDeviceDisconnectedEvent, dev)
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
Loading…
Reference in a new issue