only instantiate keystore if not already set

This commit is contained in:
Gilles Boccon-Gibod
2023-04-03 17:52:51 -07:00
parent fca73a49a3
commit 620c135ac4
2 changed files with 3 additions and 3 deletions

View File

@@ -1179,7 +1179,8 @@ class Device(CompositeEventEmitter):
# Instantiate the Key Store (we do this here rather than at __init__ time
# because some Key Store implementations use the public address as a namespace)
self.keystore = KeyStore.create_for_device(self)
if self.keystore is None:
self.keystore = KeyStore.create_for_device(self)
if self.host.supports_command(HCI_WRITE_LE_HOST_SUPPORT_COMMAND):
await self.send_command(