pyezvizapi 1.0.0.2__py3-none-any.whl → 1.0.0.3__py3-none-any.whl
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/client.py +18 -8
- pyezvizapi/light_bulb.py +1 -1
- pyezvizapi/utils.py +6 -1
- {pyezvizapi-1.0.0.2.dist-info → pyezvizapi-1.0.0.3.dist-info}/METADATA +1 -1
- {pyezvizapi-1.0.0.2.dist-info → pyezvizapi-1.0.0.3.dist-info}/RECORD +10 -10
- {pyezvizapi-1.0.0.2.dist-info → pyezvizapi-1.0.0.3.dist-info}/LICENSE +0 -0
- {pyezvizapi-1.0.0.2.dist-info → pyezvizapi-1.0.0.3.dist-info}/LICENSE.md +0 -0
- {pyezvizapi-1.0.0.2.dist-info → pyezvizapi-1.0.0.3.dist-info}/WHEEL +0 -0
- {pyezvizapi-1.0.0.2.dist-info → pyezvizapi-1.0.0.3.dist-info}/entry_points.txt +0 -0
- {pyezvizapi-1.0.0.2.dist-info → pyezvizapi-1.0.0.3.dist-info}/top_level.txt +0 -0
pyezvizapi/client.py
CHANGED
|
@@ -1363,23 +1363,31 @@ class EzvizClient:
|
|
|
1363
1363
|
|
|
1364
1364
|
return json_output["encryptkey"]
|
|
1365
1365
|
|
|
1366
|
-
def get_cam_auth_code(
|
|
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(
|
|
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:
|
|
1776
|
+
channelno: str = "1",
|
|
1767
1777
|
max_retries: int = 0,
|
|
1768
1778
|
) -> bool:
|
|
1769
1779
|
"""Set do not disturb on camera with specified serial."""
|
pyezvizapi/light_bulb.py
CHANGED
|
@@ -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 =
|
|
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:
|
pyezvizapi/utils.py
CHANGED
|
@@ -114,7 +114,12 @@ def decrypt_image(input_data: bytes, password: str) -> bytes:
|
|
|
114
114
|
return output_data
|
|
115
115
|
|
|
116
116
|
|
|
117
|
-
def
|
|
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:
|
|
@@ -3,17 +3,17 @@ pyezvizapi/__main__.py,sha256=a0JxEmkevYPmWK8V9cHt-7i8MtpztOl2IrrZ2SfEsrM,15718
|
|
|
3
3
|
pyezvizapi/api_endpoints.py,sha256=ZJ9rTfFOWVgxEZP3enaWwgiH4576eBLrVwiaOrLFvIQ,2303
|
|
4
4
|
pyezvizapi/camera.py,sha256=asP-PNoRPWR2KdlBir2NtLy4UpsLdOXzh2KyRfsir9s,11008
|
|
5
5
|
pyezvizapi/cas.py,sha256=d31ZflYSD9P40MnsNRNZbT0HVLvlnHokKpLbdAjWQ74,5631
|
|
6
|
-
pyezvizapi/client.py,sha256=
|
|
6
|
+
pyezvizapi/client.py,sha256=Tb8CQWQ1Jlwa5sGypOEj2rbpUyDP7PtcVIWQFmrtfH4,70111
|
|
7
7
|
pyezvizapi/constants.py,sha256=NWOsr57VIh3t_3it-d6hDVDYHEFiQ2MjupBj6FMte4Y,10049
|
|
8
8
|
pyezvizapi/exceptions.py,sha256=TBJGh12s4UAMVY4k3jibfjEt9D4NVgKnv-397HmfEws,608
|
|
9
|
-
pyezvizapi/light_bulb.py,sha256=
|
|
9
|
+
pyezvizapi/light_bulb.py,sha256=2v92JEQuItC8rtjxTC6qyvJaBDlcsEiVNXcNyQRltpc,5044
|
|
10
10
|
pyezvizapi/mqtt.py,sha256=Y4X99Z0Avm32SE8vog7CNsv6tGUPmPYUZUgPDGS0QJA,7866
|
|
11
11
|
pyezvizapi/test_cam_rtsp.py,sha256=w7GPcYIeK78TxL8zFDihdGSDQNWcYrurwZOr6uFzzgo,4902
|
|
12
|
-
pyezvizapi/utils.py,sha256=
|
|
13
|
-
pyezvizapi-1.0.0.
|
|
14
|
-
pyezvizapi-1.0.0.
|
|
15
|
-
pyezvizapi-1.0.0.
|
|
16
|
-
pyezvizapi-1.0.0.
|
|
17
|
-
pyezvizapi-1.0.0.
|
|
18
|
-
pyezvizapi-1.0.0.
|
|
19
|
-
pyezvizapi-1.0.0.
|
|
12
|
+
pyezvizapi/utils.py,sha256=5J10o3h-y8prWDvl3LSAF-9wS1jBgBMg5cpAEebcuSM,4936
|
|
13
|
+
pyezvizapi-1.0.0.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
14
|
+
pyezvizapi-1.0.0.3.dist-info/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
15
|
+
pyezvizapi-1.0.0.3.dist-info/METADATA,sha256=bDBDDH0uRwT5opvgxL7LMAG9Xr23YdtZHUibEwsaVOg,672
|
|
16
|
+
pyezvizapi-1.0.0.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
17
|
+
pyezvizapi-1.0.0.3.dist-info/entry_points.txt,sha256=_BSJ3eNb2H_AZkRdsv1s4mojqWn3N7m503ujvg1SudA,56
|
|
18
|
+
pyezvizapi-1.0.0.3.dist-info/top_level.txt,sha256=gMZTelIi8z7pXyTCQLLaIkxVRrDQ_lS2NEv0WgfHrHs,11
|
|
19
|
+
pyezvizapi-1.0.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|