nkgilley / python-ecobee-api

Python API for controlling Ecobee Thermostats
MIT License
44 stars 40 forks source link

Set a requests timeout #50

Closed jjlawren closed 4 years ago

jjlawren commented 4 years ago

Currently the requests calls do not specify a timeout, which means a hanging connection will never return as there's no default. This sets a hopefully sane default of 30s.

Quote from requests documentation:

You can tell Requests to stop waiting for a response after a given number of seconds with the timeout parameter. Nearly all production code should use this parameter in nearly all requests. Failure to do so can cause your program to hang indefinitely

marthoc commented 4 years ago

Looks good to me!