Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ble_read_state.py Exception when calling handler with a BLE advertising event: KeyError('0228') #28

Open
hubert3 opened this issue May 17, 2020 · 3 comments

Comments

@hubert3
Copy link

hubert3 commented May 17, 2020

Exception in ./utils/bluetooth_utils.py running ble_read_state.py

Exception is printed all over the ble_read_state screen making it hard to read

Maybe due to new hardware IDs not included in the code (AirPods Pro?)

@fuad00
Copy link

fuad00 commented Apr 26, 2021

Exception is printed all over the ble_read_state screen making it hard to read

Hi! Check out my fork: apple_bleee-exception-fix

@revolver-ocelot-saa
Copy link

I gave an answer in #30 that is hack that should make the sceen easier to read (but doesn't fix the issue).

This is a hack for sure, but you can go to utils/bluetooth_utils.py and just change the line

            if handler is not None:
                try:
                    handler(mac_addr_str, adv_type, data, rssi)
                except Exception as e:
                    print('Exception when calling handler with a BLE advertising event: %r' % (e,))

to

            if handler is not None:
                try:
                    handler(mac_addr_str, adv_type, data, rssi)
                except Exception as e:
                    #print('Exception when calling handler with a BLE advertising event: %r' % (e,))
                    pass

@ChopsKingsland
Copy link

from what I can work out it's because there are new(er) Apple devices and software out since the repo was last updated... I came to this discovery after I noticed that it wasn't detecting device state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants