Add timeout parameter to device connection #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @BobDenny ,
The default alpyca http timeout of 5 seconds is not enough in some specific case.
This include using old, non async driver with Ascom Remote.
To address this case we need a timeout parameter when creating an instance of the Alpaca client.
This PR add the parameter so for the device that need it we can do:
T = Telescope('localhost:11111', 0, 'http', 30) # use 30 second timeout
while this format still use the default of 5 seconds:
T = Telescope('localhost:11111', 0)
This is probably the less intrusive way to do it despite not all the method do require the long timeout, but it can be very complicated to use a configurable different timeout for every method.
I see in the code that only Telescope.FindHome use a specific timeout of 60 seconds, this is not modified by this change, it still use 60 seconds as specified in the _put() call.
Patrick