pyezvizapi 1.0.1.4__tar.gz → 1.0.1.6__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.
- {pyezvizapi-1.0.1.4/pyezvizapi.egg-info → pyezvizapi-1.0.1.6}/PKG-INFO +1 -1
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/__init__.py +2 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/client.py +10 -1
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/exceptions.py +4 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6/pyezvizapi.egg-info}/PKG-INFO +1 -1
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/setup.py +1 -1
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/LICENSE +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/LICENSE.md +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/MANIFEST.in +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/README.md +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/__main__.py +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/api_endpoints.py +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/camera.py +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/cas.py +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/constants.py +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/light_bulb.py +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/mqtt.py +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/test_cam_rtsp.py +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi/utils.py +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi.egg-info/SOURCES.txt +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi.egg-info/dependency_links.txt +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi.egg-info/entry_points.txt +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi.egg-info/requires.txt +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/pyezvizapi.egg-info/top_level.txt +0 -0
- {pyezvizapi-1.0.1.4 → pyezvizapi-1.0.1.6}/setup.cfg +0 -0
|
@@ -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["meta"]["code"] == 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."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|