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

backends/winrt: add address acquisition process when advertising data is None #1571

Conversation

kaz399
Copy link
Contributor

@kaz399 kaz399 commented May 10, 2024

In some situations, device.details has the scan response data only and advertising data is None.

Since the ble address cannot be obtained from device.details.adv this time, the ble address is obtained from the device.details.scan (scan response data).

… is None

In some situations, device.details has the scan response data only and
advertising data is None.

Since the ble address cannot be obtained from device.details.adv this time,
the ble address is obtained from the device.details.scan (scan response data).
@dlech
Copy link
Collaborator

dlech commented May 11, 2024

Thanks for the PR!

Can you please add a changelog entry?

Also, I'm wondering if we could write this in a way that is a bit less verbose. Maybe something like this?

data = address_or_ble_device.details
self._device_info = (data.adv or data.scan).bluetooth_address

And it would be good to fix the type hint at

adv: BluetoothLEAdvertisementReceivedEventArgs
while we are at it. (Should be Optional[BluetoothLEAdvertisementReceivedEventArgs].)

CHANGELOG: Added about changing this PR
@kaz399
Copy link
Contributor Author

kaz399 commented May 11, 2024

Thanks for the suggestion for a more concise description!
It is very clear and good.

I modify the type hints and update the changelog.

@dlech dlech merged commit 73d2cb5 into hbldh:develop May 12, 2024
13 checks passed
@dlech
Copy link
Collaborator

dlech commented May 12, 2024

Thanks for updating!

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

Successfully merging this pull request may close these issues.

2 participants