Skip to content

Commit

Permalink
Formatting requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
pjrt committed Aug 26, 2021
1 parent f428841 commit 88e4244
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/amcrest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from .system import System
from .user_management import UserManagement
from .video import Video
from .privacy_mode import PrivacyMode


class AmcrestCamera:
Expand Down
16 changes: 11 additions & 5 deletions src/amcrest/privacy_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,26 @@

from .http import Http

# This API is based on an undocumented API of Amcrest Cameras. This API may change without notice

# This API is based on an undocumented API of Amcrest Cameras.
# This API may change without notice
class PrivacyMode(Http):
@property
def privacy_set(self, turn_on: bool) -> str:
def privacy_set(self, mode: bool) -> str:
"""
Params:
turn_on - True to enable privacy mode, false to disable
mode - True to enable privacy mode, false to disable
Turns on privacy mode on or off in the camera
"""
ret = self.command(f"configManager.cgi?action=setConfig&LeLensMask[0].Enable={turn_on}")
ret = self.command(
f"configManager.cgi?action=setConfig&LeLensMask[0].Enable={mode}"
)
return ret.content.decode()

@property
def privacy_config(self) -> str:
ret = self.command(f"configManager.cgi?action=getConfig&name=LeLensMask")
ret = self.command(
"configManager.cgi?action=getConfig&name=LeLensMask"
)
return ret.content.decode()

0 comments on commit 88e4244

Please sign in to comment.