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
Added OnvifLoginCheck to system #178
Conversation
src/amcrest/system.py
Outdated
ret = self.command( | ||
"configManager.cgi?action=setConfig&UserGlobal.OnvifLoginCheck=false" | ||
) | ||
return ret.content.decode('utf-8') |
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.
no newline at end of file
src/amcrest/system.py
Outdated
) | ||
else: | ||
ret = self.command( | ||
"configManager.cgi?action=setConfig&UserGlobal.OnvifLoginCheck=false" |
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.
line too long (85 > 79 characters)
src/amcrest/system.py
Outdated
def onvif_login_check(self, setCheck=False): | ||
if setCheck == True: | ||
ret = self.command( | ||
"configManager.cgi?action=setConfig&UserGlobal.OnvifLoginCheck=true" |
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.
line too long (84 > 79 characters)
src/amcrest/system.py
Outdated
@@ -165,3 +165,14 @@ def reboot(self, delay=None): | |||
|
|||
ret = self.command(cmd) | |||
return ret.content.decode('utf-8') | |||
|
|||
def onvif_login_check(self, setCheck=False): | |||
if setCheck == True: |
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.
comparison to True should be 'if cond is True:' or 'if cond:'
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.
@Slyke how about this?
def onvif_login_check(self, setCheck=False):
"""DOC HERE """
cmd = 'configManager.cgi?action=setConfig'
cmd += "&UserGlobal.OnvifLoginCheck={0}".format(str(setCheck))
ret = self.command(cmd)
""" | ||
cmd = 'configManager.cgi?action=setConfig' | ||
cmd += "&UserGlobal.OnvifLoginCheck={0}".format(str(setCheck)) | ||
ret = self.command(cmd) |
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.
local variable 'ret' is assigned to but never used
@tchellomello works for me! Updated Note the
|
Looks good, thanks! |
Adding the ability to turn off OnvifLoginCheck. This allows other accounts to use Onvif functionality. currently only the
admin
account can.Details are in this thread: https://amcrest.com/forum/ip-cameras-f18/ip3m-941b-onvif-and-user-management-t12647-s20.html