Skip to content

Reolink api v7 #65

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Permit changing passwords on v7 firmware
  • Loading branch information
Vaelatern committed Nov 8, 2022
commit 5eabd1f9a783a232f510cc5deeab03a3aea888d0
7 changes: 4 additions & 3 deletions reolinkapi/mixins/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ def add_user(self, username: str, password: str, level: str = "guest") -> bool:
print("Could not add user. Camera responded with:", r_data["value"])
return False

def modify_user(self, username: str, password: str) -> bool:
def modify_user(self, username: str, oldPassword: str, newPassword: str) -> bool:
"""
Modify the user's password by specifying their username
:param username: The user which would want to be modified
:param password: The new password
:param oldPassword: The old password
:param newPassword: The new password
:return: whether the user was modified successfully
"""
body = [{"cmd": "ModifyUser", "action": 0, "param": {"User": {"userName": username, "password": password}}}]
body = [{"cmd": "ModifyUser", "action": 0, "param": {"User": {"userName": username, "oldPassword": oldPassword, "newPassword": newPassword}}}]
r_data = self._execute_command('ModifyUser', body)[0]
if r_data["value"]["rspCode"] == 200:
return True
Expand Down