-
Notifications
You must be signed in to change notification settings - Fork 24
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
No way to stop a BridgeFinder scan #31
Comments
Right now there are two ways implemented to scan for bridges: SSDPScanner which searches inside the local network and NUPNPScanner which makes a REST call to the Hue-cloud to receive the devices.
and the second method is a standard HTTP request with the standard timeout of 60 seconds
This is just for finding the bridge IP after that it also needs to call each IP to validate that it is a valid bridge which is done with a REST call again:
I guess it would make sense to reduce the HTTP-timeouts a litte bit to 10-15seconds or something like that. So right now it is not scanning forever. Adding a
The remaining work would be to also cancel the request in the NUPNPScanner scanner and for the validator requests.
|
Thanks for the detailed update. Yeah I was looking deeper into the docs for Hue. It actually looks like they now prefer mDNS for discovery. I actually implemented a mDNS scanner in this architecture as an additional scanner. I did see that there are several scanners at play, prioritized by preferred scanning methods first. Which would make stop() or cancel() a little tricky. I was just thinking that it would be nice to cleanup the scanners if the user decided to stop waiting for scanning. etc... |
As a workaround: I guess you could just remove the delegate and dealloc the object. It would still run in the background until the internal timeout is finished and then it is removed, but it won't call the delegate methods. Not the nicest way though, but should work. |
I can't seem to find a way to actually stop the scanner during the BridgeFinder flow. For example if you wanted to stop the scan with some timeout etc... I don't see any public API on the BridgeFinder class.
The text was updated successfully, but these errors were encountered: