Skip to content

Commit 8f23966

Browse files
authored
Update camera.py
Adding profile so sub can be used. This is useful for low power devices like raspberry pi.
1 parent 02da106 commit 8f23966

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

reolinkapi/camera.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def __init__(self, ip: str,
88
password: str = "",
99
https: bool = False,
1010
defer_login: bool = False,
11+
profile: str = "main",
1112
**kwargs):
1213
"""
1314
Initialise the Camera object by passing the ip address.
@@ -23,6 +24,9 @@ def __init__(self, ip: str,
2324
eg: {"http":"socks5://[username]:[password]@[host]:[port], "https": ...}
2425
More information on proxies in requests: https://stackoverflow.com/a/15661226/9313679
2526
"""
27+
if profile not in ["main", "sub"]:
28+
raise Exception("Profile argument must be either \"main\" or \"sub\"")
29+
2630
# For when you need to connect to a camera behind a proxy, pass
2731
# a proxy argument: proxy={"http": "socks5://127.0.0.1:8000"}
2832
APIHandler.__init__(self, ip, username, password, https=https, **kwargs)
@@ -33,6 +37,7 @@ def __init__(self, ip: str,
3337
self.ip = ip
3438
self.username = username
3539
self.password = password
40+
self.profile = profile
3641

3742
if not defer_login:
3843
super().login()

0 commit comments

Comments
 (0)