From fda00dcb28c313d7bc6d4909ed235fb745b2f335 Mon Sep 17 00:00:00 2001 From: Alan Rosenthal Date: Wed, 22 Mar 2023 09:33:55 -0400 Subject: [PATCH] Used pytype to find some missing types ``` pytype --pythonpath . ./bumble/device.py ``` --- bumble/device.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bumble/device.py b/bumble/device.py index 512bb1d..37023bb 100644 --- a/bumble/device.py +++ b/bumble/device.py @@ -310,6 +310,9 @@ class AdvertisementDataAccumulator: def update(self, report): advertisement = Advertisement.from_advertising_report(report) + if advertisement is None: + return None + result = None if advertisement.is_scan_response: @@ -2776,7 +2779,7 @@ class Device(CompositeEventEmitter): # [Classic only] @host_event_handler @try_with_connection_from_address - def on_remote_name(self, connection, address, remote_name): + def on_remote_name(self, connection: Connection, address, remote_name): # Try to decode the name try: remote_name = remote_name.decode('utf-8') @@ -2794,7 +2797,7 @@ class Device(CompositeEventEmitter): # [Classic only] @host_event_handler @try_with_connection_from_address - def on_remote_name_failure(self, connection, address, error): + def on_remote_name_failure(self, connection: Connection, address, error): if connection: connection.emit('remote_name_failure', error) self.emit('remote_name_failure', address, error)