From 9bcdf860f4da735797a92e99c4e2eebd4f75f44c Mon Sep 17 00:00:00 2001 From: Gilles Boccon-Gibod Date: Sat, 30 Sep 2023 17:41:18 -0700 Subject: [PATCH] don't delete advertising prefs on disconnection --- bumble/device.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bumble/device.py b/bumble/device.py index b01dc58b..056da72a 100644 --- a/bumble/device.py +++ b/bumble/device.py @@ -1425,10 +1425,10 @@ class Device(CompositeEventEmitter): check_result=True, ) - self.advertising_own_address_type = own_address_type - self.auto_restart_advertising = auto_restart self.advertising_type = advertising_type + self.advertising_own_address_type = own_address_type self.advertising = True + self.auto_restart_advertising = auto_restart async def stop_advertising(self) -> None: # Disable advertising @@ -1438,9 +1438,9 @@ class Device(CompositeEventEmitter): check_result=True, ) + self.advertising_type = None self.advertising_own_address_type = None self.advertising = False - self.advertising_type = None self.auto_restart_advertising = False @property @@ -2630,7 +2630,6 @@ class Device(CompositeEventEmitter): own_address_type = self.advertising_own_address_type # We are no longer advertising - self.advertising_own_address_type = None self.advertising = False if own_address_type in ( @@ -2687,7 +2686,6 @@ class Device(CompositeEventEmitter): and self.advertising and self.advertising_type.is_directed ): - self.advertising_own_address_type = None self.advertising = False # Notify listeners