-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[bluetooth] Increase discovery duration and fix labels #10154
Conversation
Signed-off-by: Kai Kreuzer <[email protected]>
While it might appear that discovery starts a bluetooth scan it actually doesn't. The bluetooth adapters are constantly performing device scanning in order to catch beacon advertisement packets so bluetooth scanning never stops. The only thing that happens when you start a scan for bluetooth devices is that the adapters will publish their known devices to the bluetooth discovery service. The reason that it takes some time for the discovery results to trickle in is that the discovery service has to attempt connections to each of the reported devices to give the bluetooth discovery participants the information they need to create a discovery result. Connections take time and only so many connections can be done at once, so that is why the results trickle in rather than show up all at once. That said, I have no problem extending the scan time if you think it would help. But I don't want to remove the bridge info from the label until the UI can display the bridge information in some other way. |
Could this information be cached in the discovery service so that devices that are still in reach can be added as a discovery result right away (again)?
This really messes up the inbox result and we do not do it for other devices. I'd want to avoid that people think that's the way to do it and copy that behavior. In 95% of the cases, users will have only a single bridge anyhow. |
Since I see the bridge UID is part of the |
@ghys I don't see any necessity to display a label - I rather prefer the "real truth" by seeing the bridge id, just like we also show the thing type id (instead of its label). A very easy solution might hence even be to merely replace the thing type id by the discovery result UID - then we would have everything relevant visible immediately. |
Ok, the discovery change is not required since #10187 is the proper fix. |
15 seconds appears far too short - upon every discovery, I have a different set of BT devices in the inbox as all results are cleaned with the next discovery and many devices do not broadcast themselves within the 15 seconds range.
Also, discovery result labels must not contain labels of the bridges, but should only describe the discovered thing itself.
I see the point of hinting the user about what bridge was involved here, but we have this information in the ThingUID already.
@ghys How hard would it be for the inbox to render the id of the bridge (if any) next to the representation property? Have you already thought about such a feature?
Signed-off-by: Kai Kreuzer [email protected]