-
Notifications
You must be signed in to change notification settings - Fork 77
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
Use unique amcrest exceptions #108
Conversation
Use amcrest specific exceptions where appropriate, such as for communication and login errors. Use retries and timeouts when generating authentation object. Check for invalid login when using Basic Authentication.
One change I'm not absolutely sure about. I noticed in Http._generate_token that the response from the camera was only checked for "invalid" and "error" if Digest Authentication was used. Specifically, it did not do this test if Basic Authentication was used. I suspected this was an oversight, so I changed it to do the test no matter which authentication type was used. Is that correct? Or did it only do that check if Digest Authentication was used on purpose? |
@@ -10,8 +10,8 @@ | |||
# GNU General Public License for more details. | |||
# | |||
# vim:sw=4:ts=4:et | |||
|
|||
from amcrest.http import Http | |||
from .exceptions import AmcrestError, CommError, LoginError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'.exceptions.AmcrestError' imported but unused
'.exceptions.CommError' imported but unused
'.exceptions.LoginError' imported but unused
Also, although these changes technically constitute an API change, it may not be worth going to version 2.0.0. 1.2.6 should be fine. Once these changes are released on pypi.org as a new version I'll update the HA amcrest components accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome @pnbruckner you rock!
Use amcrest specific exceptions where appropriate, such as for communication and login errors. Use retries and timeouts when generating authentation object. Check for invalid login when using Basic Authentication.