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

There is a race where we can be waiting for the device to be detected at startup and we get it more than once because we don't clear it before its detected again #266

Open
bdraco opened this issue Dec 3, 2022 · 0 comments

Comments

@bdraco
Copy link
Collaborator

bdraco commented Dec 3, 2022

2022-12-03 18:26:47.215 ERROR (MainThread) [homeassistant.components.bluetooth.manager] Error in callback: <bound method BleController._device_detected of <aiohomekit.controller.ble.controller.BleController object at 0x7f6ac8a69450>>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/manager.py", line 92, in _dispatch_bleak_callback
    callback(device, advertisement_data)
  File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/controller.py", line 106, in _device_detected
    future.set_result(discovery)
asyncio.exceptions.InvalidStateError: invalid state
2022-12-03 18:26:47.225 DEBUG (MainThread) [aiohomekit.controller.ble.pairing] [CE:E7:37:9D:36:60] (id=D5:2F:11:1D:88:F2): Description updated: old=None new=HomeKitAdvertisement(name='VOCOlinc-VS1-1857C6', id='d5:2f:11:1d:88:f2', status_flags=<StatusFlags.0: 0>, config_num=1, category=<Categories.SENSOR: 10>, setup_hash=b'\xb00U\xa3', address='CE:E7:37:9D:36:60', state_num=34)
2022-12-03 18:26:47.225 DEBUG (MainThread) [aiohomekit.controller.abstract] [CE:E7:37:9D:36:60] (id=D5:2F:11:1D:88:F2): Description updated: old=None new=HomeKitAdvertisement(name='VOCOlinc-VS1-1857C6', id='d5:2f:11:1d:88:f2', status_flags=<StatusFlags.0: 0>, config_num=1, category=<Categories.SENSOR: 10>, setup_hash=b'\xb00U\xa3', address='CE:E7:37:9D:36:60', state_num=34)
2022-12-03 18:26:47.226 DEBUG (MainThread) [aiohomekit.controller.abstract] [CE:E7:37:9D:36:60] (id=D5:2F:11:1D:88:F2): Disconnected event notification received; Triggering catch-up poll
2022-12-03 18:26:47.229 DEBUG (MainThread) [aiohomekit.controller.ble.controller] BLE device for CE:E7:37:9D:36:60 found, fulfilling futures
2022-12-03 18:26:47.229 ERROR (MainThread) [homeassistant.components.bluetooth.manager] Error in callback: <bound method BleController._device_detected of <aiohomekit.controller.ble.controller.BleController object at 0x7f6ac8a69450>>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/manager.py", line 92, in _dispatch_bleak_callback
    callback(device, advertisement_data)
  File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/controller.py", line 106, in _device_detected
    future.set_result(discovery)
asyncio.exceptions.InvalidStateError: invalid 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

1 participant