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

Add service data #11

Merged
merged 1 commit into from
Oct 19, 2023
Merged

Add service data #11

merged 1 commit into from
Oct 19, 2023

Conversation

emontnemery
Copy link
Collaborator

@emontnemery emontnemery commented Oct 18, 2023

This PR implements the necessary changes to support an updated version of the Improv via BLE spec which adds service data

ESPHome PR: esphome/esphome#5553

Note: The spec has not yet been updated

except InvalidCommand:
return False
return improv_service_data.state not in (
prot.State.PROVISIONING,
Copy link
Collaborator Author

@emontnemery emontnemery Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should filter out devices which are provisioning?

@MartinHjelmare
Copy link

What's the goal with this PR?

Copy link
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bdraco
Copy link
Member

bdraco commented Oct 18, 2023

What's the goal with this PR?

The current state and capabilities are now in the advertisement data so when it changes to already provisioned or provisioning we will no longer offer the device to the user via discovery.

The previous design relied on the service uuid disappearing, but service uuids only expire when the device goes out of range (maybe not even than depending on the Bluetooth stack). If the device stays in range forever the previous design would offer to set up WiFi even though it was already provisioned.

@emontnemery emontnemery merged commit 093d4bf into main Oct 19, 2023
@emontnemery emontnemery deleted the service_data branch October 19, 2023 11:31
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.

3 participants