pyezvizapi 1.0.0.2__tar.gz → 1.0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {pyezvizapi-1.0.0.2/pyezvizapi.egg-info → pyezvizapi-1.0.0.3}/PKG-INFO +1 -1
  2. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/client.py +18 -8
  3. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/light_bulb.py +1 -1
  4. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/utils.py +6 -1
  5. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3/pyezvizapi.egg-info}/PKG-INFO +1 -1
  6. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/setup.py +1 -1
  7. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/LICENSE +0 -0
  8. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/LICENSE.md +0 -0
  9. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/MANIFEST.in +0 -0
  10. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/README.md +0 -0
  11. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/__init__.py +0 -0
  12. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/__main__.py +0 -0
  13. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/api_endpoints.py +0 -0
  14. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/camera.py +0 -0
  15. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/cas.py +0 -0
  16. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/constants.py +0 -0
  17. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/exceptions.py +0 -0
  18. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/mqtt.py +0 -0
  19. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi/test_cam_rtsp.py +0 -0
  20. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi.egg-info/SOURCES.txt +0 -0
  21. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi.egg-info/dependency_links.txt +0 -0
  22. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi.egg-info/entry_points.txt +0 -0
  23. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi.egg-info/requires.txt +0 -0
  24. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/pyezvizapi.egg-info/top_level.txt +0 -0
  25. {pyezvizapi-1.0.0.2 → pyezvizapi-1.0.0.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyezvizapi
3
- Version: 1.0.0.2
3
+ Version: 1.0.0.3
4
4
  Summary: Pilot your Ezviz cameras
5
5
  Home-page: https://github.com/RenierM26/pyEzvizApi/
6
6
  Author: Renier Moorcroft
@@ -1363,23 +1363,31 @@ class EzvizClient:
1363
1363
 
1364
1364
  return json_output["encryptkey"]
1365
1365
 
1366
- def get_cam_auth_code(self, serial: str, max_retries: int = 0) -> Any:
1366
+ def get_cam_auth_code(
1367
+ self,
1368
+ serial: str,
1369
+ encrypt_pwd: str | None = None,
1370
+ msg_auth_code: int | None = None,
1371
+ max_retries: int = 0,
1372
+ ) -> Any:
1367
1373
  """Get Camera auth code. This is the verification code on the camera sticker."""
1368
1374
 
1369
1375
  if max_retries > MAX_RETRIES:
1370
1376
  raise PyEzvizError("Can't gather proper data. Max retries exceeded.")
1371
1377
 
1378
+ params: dict[str, int | str | None] = {
1379
+ "encrptPwd": encrypt_pwd,
1380
+ "msgAuthCode": msg_auth_code,
1381
+ "senderType": 0,
1382
+ }
1383
+
1372
1384
  try:
1373
1385
  req = self._session.get(
1374
1386
  "https://"
1375
1387
  + self._token["api_url"]
1376
1388
  + API_ENDPOINT_CAM_AUTH_CODE
1377
1389
  + serial,
1378
- params={
1379
- "encrptPwd": "",
1380
- "msgAuthCode": "",
1381
- "senderType": 0,
1382
- },
1390
+ params=params,
1383
1391
  timeout=self._timeout,
1384
1392
  )
1385
1393
 
@@ -1389,7 +1397,9 @@ class EzvizClient:
1389
1397
  if err.response.status_code == 401:
1390
1398
  # session is wrong, need to relogin
1391
1399
  self.login()
1392
- return self.get_cam_auth_code(serial, max_retries + 1)
1400
+ return self.get_cam_auth_code(
1401
+ serial, encrypt_pwd, msg_auth_code, max_retries + 1
1402
+ )
1393
1403
 
1394
1404
  raise HTTPError from err
1395
1405
 
@@ -1763,7 +1773,7 @@ class EzvizClient:
1763
1773
  self,
1764
1774
  serial: str,
1765
1775
  enable: int = 1,
1766
- channelno: int = 1,
1776
+ channelno: str = "1",
1767
1777
  max_retries: int = 0,
1768
1778
  ) -> bool:
1769
1779
  """Set do not disturb on camera with specified serial."""
@@ -66,7 +66,7 @@ class EzvizLightBulb:
66
66
 
67
67
  return json_output
68
68
 
69
- def get_feature_item(self, key: str, default_value: Any = None) -> Any:
69
+ def get_feature_item(self, key: str, default_value: Any = { "dataValue" : "" }) -> Any:
70
70
  """Get items fron FEATURE."""
71
71
  items = self._feature_json["featureItemDtos"]
72
72
  for item in items:
@@ -114,7 +114,12 @@ def decrypt_image(input_data: bytes, password: str) -> bytes:
114
114
  return output_data
115
115
 
116
116
 
117
- def deep_merge(dict1, dict2):
117
+ def return_password_hash(password: str) -> str:
118
+ """Return the password hash."""
119
+ return md5(str.encode(md5(str.encode(password)).hexdigest())).hexdigest()
120
+
121
+
122
+ def deep_merge(dict1: Any, dict2: Any) -> Any:
118
123
  """Recursively merges two dictionaries, handling lists as well.
119
124
 
120
125
  Args:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyezvizapi
3
- Version: 1.0.0.2
3
+ Version: 1.0.0.3
4
4
  Summary: Pilot your Ezviz cameras
5
5
  Home-page: https://github.com/RenierM26/pyEzvizApi/
6
6
  Author: Renier Moorcroft
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name='pyezvizapi',
8
- version="1.0.0.2",
8
+ version="1.0.0.3",
9
9
  license='Apache Software License 2.0',
10
10
  author='Renier Moorcroft',
11
11
  author_email='RenierM26@users.github.com',
File without changes
File without changes
File without changes
File without changes
File without changes