pyezvizapi 1.0.1.4__tar.gz → 1.0.1.5__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.

Potentially problematic release.


This version of pyezvizapi might be problematic. Click here for more details.

Files changed (25) hide show
  1. {pyezvizapi-1.0.1.4/pyezvizapi.egg-info → pyezvizapi-1.0.1.5}/PKG-INFO +1 -1
  2. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/__init__.py +2 -0
  3. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/client.py +10 -1
  4. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/exceptions.py +4 -0
  5. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5/pyezvizapi.egg-info}/PKG-INFO +1 -1
  6. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/setup.py +1 -1
  7. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/LICENSE +0 -0
  8. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/LICENSE.md +0 -0
  9. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/MANIFEST.in +0 -0
  10. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/README.md +0 -0
  11. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/__main__.py +0 -0
  12. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/api_endpoints.py +0 -0
  13. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/camera.py +0 -0
  14. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/cas.py +0 -0
  15. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/constants.py +0 -0
  16. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/light_bulb.py +0 -0
  17. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/mqtt.py +0 -0
  18. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/test_cam_rtsp.py +0 -0
  19. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi/utils.py +0 -0
  20. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi.egg-info/SOURCES.txt +0 -0
  21. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi.egg-info/dependency_links.txt +0 -0
  22. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi.egg-info/entry_points.txt +0 -0
  23. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi.egg-info/requires.txt +0 -0
  24. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/pyezvizapi.egg-info/top_level.txt +0 -0
  25. {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyezvizapi
3
- Version: 1.0.1.4
3
+ Version: 1.0.1.5
4
4
  Summary: Pilot your Ezviz cameras
5
5
  Home-page: https://github.com/RenierM26/pyEzvizApi/
6
6
  Author: Renier Moorcroft
@@ -19,6 +19,7 @@ from .constants import (
19
19
  )
20
20
  from .exceptions import (
21
21
  AuthTestResultFailed,
22
+ DeviceException,
22
23
  EzvizAuthTokenExpired,
23
24
  EzvizAuthVerificationCode,
24
25
  HTTPError,
@@ -37,6 +38,7 @@ __all__ = [
37
38
  "BatteryCameraWorkMode",
38
39
  "DefenseModeType",
39
40
  "DeviceCatagories",
41
+ "DeviceException",
40
42
  "DeviceSwitchType",
41
43
  "DisplayMode",
42
44
  "EzvizAuthTokenExpired",
@@ -71,6 +71,7 @@ from .constants import (
71
71
  MessageFilterType,
72
72
  )
73
73
  from .exceptions import (
74
+ DeviceException,
74
75
  EzvizAuthTokenExpired,
75
76
  EzvizAuthVerificationCode,
76
77
  HTTPError,
@@ -1369,6 +1370,7 @@ class EzvizClient:
1369
1370
  Raises:
1370
1371
  PyEzvizError: If the camera encryption key can't be retrieved.
1371
1372
  EzvizAuthVerificationCode: If the account requires elevation with 2FA code.
1373
+ DeviceException: If the physical device is not reachable.
1372
1374
 
1373
1375
  Returns:
1374
1376
  Any: JSON response, filtered to return encryptkey:
@@ -1421,6 +1423,9 @@ class EzvizClient:
1421
1423
  if json_output["resultCode"] == "20002":
1422
1424
  raise EzvizAuthVerificationCode(f"MFA code required: Got {json_output})")
1423
1425
 
1426
+ if json_output["resultCode"] == 2009:
1427
+ raise DeviceException(f"Device not reachable: Got {json_output})")
1428
+
1424
1429
  if json_output["resultCode"] != "0":
1425
1430
  if json_output["resultCode"] == "-1":
1426
1431
  _LOGGER.warning(
@@ -1456,6 +1461,7 @@ class EzvizClient:
1456
1461
  Raises:
1457
1462
  PyEzvizError: If the camera auth code cannot be retrieved.
1458
1463
  EzvizAuthVerificationCode: If the operation requires elevation with 2FA.
1464
+ DeviceException: If the physical device is not reachable.
1459
1465
 
1460
1466
  Returns:
1461
1467
  Any: JSON response, filtered to return devAuthCode:
@@ -1511,9 +1517,12 @@ class EzvizClient:
1511
1517
  if json_output["meta"]["code"] == 80000:
1512
1518
  raise EzvizAuthVerificationCode("Operation requires 2FA check")
1513
1519
 
1520
+ if json_output["resultCode"] == 2009:
1521
+ raise DeviceException(f"Device not reachable: Got {json_output}")
1522
+
1514
1523
  if json_output["meta"]["code"] != 200:
1515
1524
  raise PyEzvizError(
1516
- f"Could not get camera verification key: Got {json_output})"
1525
+ f"Could not get camera verification key: Got {json_output}"
1517
1526
  )
1518
1527
 
1519
1528
  return json_output["devAuthCode"]
@@ -27,3 +27,7 @@ class EzvizAuthTokenExpired(PyEzvizError):
27
27
 
28
28
  class EzvizAuthVerificationCode(PyEzvizError):
29
29
  """Authentication failed because MFA verification code is required."""
30
+
31
+
32
+ class DeviceException(PyEzvizError):
33
+ """The device network is abnormal, please check the device network or try again."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyezvizapi
3
- Version: 1.0.1.4
3
+ Version: 1.0.1.5
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.1.4",
8
+ version="1.0.1.5",
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