Skip to content

Commit

Permalink
Merge pull request #128 from BaQs/ezviz_cleanup_encryption_key
Browse files Browse the repository at this point in the history
Cleanup return for camera encryption key, add advanced detect to camera.
  • Loading branch information
RenierM26 committed Jul 8, 2023
2 parents 56af67e + d24e93e commit 6847216
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pyezviz/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ def status(self) -> dict[Any, Any]:
"batteryCameraWorkMode": self.fetch_key(
["STATUS", "optionals", "workMode"]
),
"Alarm_AdvancedDetect": self.fetch_key(
["STATUS", "optionals", "Alarm_AdvancedDetect", "type"]
),
"wifiInfos": self._device["WIFI"],
"switches": self._switch,
"optionals": self.fetch_key(["STATUS", "optionals"]),
Expand Down
4 changes: 2 additions & 2 deletions pyezviz/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ def ptz_control(
def get_cam_key(
self, serial: str, smscode: int | None = None, max_retries: int = 0
) -> Any:
"""Get Camera encryption key."""
"""Get Camera encryption key. The key that is set after the camera is added to the account."""

if max_retries > MAX_RETRIES:
raise PyEzvizError("Can't gather proper data. Max retries exceeded.")
Expand Down Expand Up @@ -1234,7 +1234,7 @@ def get_cam_key(
f"Could not get camera encryption key: Got {json_output})"
)

return json_output
return json_output["encryptkey"]

def create_panoramic(self, serial: str, max_retries: int = 0) -> Any:
"""Create panoramic image."""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='pyezviz',
version="0.2.2.0",
version="0.2.2.1",
license='Apache Software License 2.0',
author='Pierre Ourdouille',
author_email='baqs@users.github.com',
Expand Down

0 comments on commit 6847216

Please sign in to comment.