Skip to content

Commit ae977b9

Browse files
authored
feat: avoid building on demand AdvertisementData if there are no bleak callbacks (#180)
1 parent c86e63a commit ae977b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/habluetooth/manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,9 @@ def scanner_adv_received(self, service_info: BluetoothServiceInfoBleak) -> None:
629629
# will be called and the device can be discovered.
630630
service_info = service_info._as_connectable()
631631

632-
if (service_info.connectable or old_connectable_service_info is not None) and (
633-
self._bleak_callbacks is not None
634-
):
632+
if (
633+
service_info.connectable or old_connectable_service_info is not None
634+
) and self._bleak_callbacks:
635635
# Bleak callbacks must get a connectable device
636636
advertisement_data = service_info._advertisement_internal()
637637
for bleak_callback in self._bleak_callbacks:

0 commit comments

Comments
 (0)