tchellomello / python-amcrest

A Python 2.7/3.x module for Amcrest and Dahua Cameras using the SDK HTTP API.
GNU General Public License v2.0
216 stars 76 forks source link

Unset the token when there's a communication error generating it #124

Closed antlarr closed 5 years ago

antlarr commented 5 years ago

If the camera gives a CommError (for example because it's not reachable) when calling _generate_token, the _token should be unset, as otherwise the token will be reused for every command and it won't be (re)generated correctly when the camera is back online.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.1%) to 31.818% when pulling e75b64b67fe167b7bbfdb1b1b355b1b317d30752 on antlarr:master into 625f8577300693a2b46c3acf39694e46d72073d9 on tchellomello:master.

tchellomello commented 5 years ago

Awesome!! Thanks for your contribution @antlarr