pyezvizapi 1.0.1.9__py3-none-any.whl → 1.0.2.1__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 +17 -11
- pyezvizapi/constants.py +1 -0
- {pyezvizapi-1.0.1.9.dist-info → pyezvizapi-1.0.2.1.dist-info}/METADATA +1 -1
- {pyezvizapi-1.0.1.9.dist-info → pyezvizapi-1.0.2.1.dist-info}/RECORD +9 -9
- {pyezvizapi-1.0.1.9.dist-info → pyezvizapi-1.0.2.1.dist-info}/WHEEL +0 -0
- {pyezvizapi-1.0.1.9.dist-info → pyezvizapi-1.0.2.1.dist-info}/entry_points.txt +0 -0
- {pyezvizapi-1.0.1.9.dist-info → pyezvizapi-1.0.2.1.dist-info}/licenses/LICENSE +0 -0
- {pyezvizapi-1.0.1.9.dist-info → pyezvizapi-1.0.2.1.dist-info}/licenses/LICENSE.md +0 -0
- {pyezvizapi-1.0.1.9.dist-info → pyezvizapi-1.0.2.1.dist-info}/top_level.txt +0 -0
pyezvizapi/client.py
CHANGED
|
@@ -167,6 +167,7 @@ class EzvizClient:
|
|
|
167
167
|
DeviceCatagories.BASE_STATION_DEVICE_CATEGORY.value,
|
|
168
168
|
DeviceCatagories.CAT_EYE_CATEGORY.value,
|
|
169
169
|
DeviceCatagories.LIGHTING.value,
|
|
170
|
+
DeviceCatagories.W2H_BASE_STATION_DEVICE_CATEGORY.value, # @emeric699 Adding support for W2H Base Station
|
|
170
171
|
]
|
|
171
172
|
|
|
172
173
|
def __init__(
|
|
@@ -557,7 +558,8 @@ class EzvizClient:
|
|
|
557
558
|
page_filter, json_key, group_id, limit, offset, max_retries + 1
|
|
558
559
|
)
|
|
559
560
|
|
|
560
|
-
|
|
561
|
+
page_info = json_output.get("page") or {}
|
|
562
|
+
next_page = bool(page_info.get("hasNext", False))
|
|
561
563
|
|
|
562
564
|
data = json_output[json_key] if json_key else json_output
|
|
563
565
|
|
|
@@ -990,10 +992,11 @@ class EzvizClient:
|
|
|
990
992
|
|
|
991
993
|
refresh: if True, camera.status() may perform network fetches (e.g. alarms).
|
|
992
994
|
Returns a combined mapping of serial -> status dict for both cameras and bulbs.
|
|
995
|
+
|
|
996
|
+
Note: We update in place and do not remove keys for devices that may
|
|
997
|
+
have disappeared. Users who intentionally remove a device can restart
|
|
998
|
+
the integration to flush stale entries.
|
|
993
999
|
"""
|
|
994
|
-
# Reset caches to reflect the current device roster
|
|
995
|
-
self._cameras.clear()
|
|
996
|
-
self._light_bulbs.clear()
|
|
997
1000
|
|
|
998
1001
|
# Build lightweight records for clean gating/selection
|
|
999
1002
|
records = cast(dict[str, EzvizDeviceRecord], self.get_device_records(None))
|
|
@@ -1033,7 +1036,6 @@ class EzvizClient:
|
|
|
1033
1036
|
"load_error",
|
|
1034
1037
|
str(err),
|
|
1035
1038
|
)
|
|
1036
|
-
|
|
1037
1039
|
return {**self._cameras, **self._light_bulbs}
|
|
1038
1040
|
|
|
1039
1041
|
def load_cameras(self, refresh: bool = True) -> dict[Any, Any]:
|
|
@@ -1058,7 +1060,7 @@ class EzvizClient:
|
|
|
1058
1060
|
result: dict[str, Any] = {}
|
|
1059
1061
|
_res_id = "NONE"
|
|
1060
1062
|
|
|
1061
|
-
for device in devices
|
|
1063
|
+
for device in devices.get("deviceInfos", []) or []:
|
|
1062
1064
|
_serial = device["deviceSerial"]
|
|
1063
1065
|
_res_id_list = {
|
|
1064
1066
|
item
|
|
@@ -1088,16 +1090,20 @@ class EzvizClient:
|
|
|
1088
1090
|
},
|
|
1089
1091
|
"resourceInfos": [
|
|
1090
1092
|
item
|
|
1091
|
-
for item in devices.get("resourceInfos")
|
|
1092
|
-
if item.get("deviceSerial") == _serial
|
|
1093
|
+
for item in (devices.get("resourceInfos") or [])
|
|
1094
|
+
if isinstance(item, dict) and item.get("deviceSerial") == _serial
|
|
1093
1095
|
], # Could be more than one
|
|
1094
1096
|
"WIFI": devices.get("WIFI", {}).get(_serial, {}),
|
|
1095
1097
|
"deviceInfos": device,
|
|
1096
1098
|
}
|
|
1097
1099
|
# Nested keys are still encoded as JSON strings
|
|
1098
|
-
|
|
1099
|
-
result[_serial]
|
|
1100
|
-
|
|
1100
|
+
try:
|
|
1101
|
+
support_ext = result[_serial].get("deviceInfos", {}).get("supportExt")
|
|
1102
|
+
if isinstance(support_ext, str) and support_ext:
|
|
1103
|
+
result[_serial]["deviceInfos"]["supportExt"] = json.loads(support_ext)
|
|
1104
|
+
except (TypeError, ValueError):
|
|
1105
|
+
# Leave as-is if not valid JSON
|
|
1106
|
+
pass
|
|
1101
1107
|
convert_to_dict(result[_serial]["STATUS"].get("optionals"))
|
|
1102
1108
|
|
|
1103
1109
|
if not serial:
|
pyezvizapi/constants.py
CHANGED
|
@@ -3,8 +3,8 @@ pyezvizapi/__main__.py,sha256=SeV954H-AV-U1thNxRd7rWTGtSlfWyNzdrjF8gikYus,20777
|
|
|
3
3
|
pyezvizapi/api_endpoints.py,sha256=rk6VinLVCn-B6DxnhfV79liplNpgUsipNbTEa_MRVwU,2755
|
|
4
4
|
pyezvizapi/camera.py,sha256=Vpuh7RkUBfSmNCFAXaALzfvvL0RD3SzJJyWqwZzWuHk,25191
|
|
5
5
|
pyezvizapi/cas.py,sha256=ISmb-eTPuacI10L87lULbQ-oDMBuygO7Tf-s9f-tvYE,5995
|
|
6
|
-
pyezvizapi/client.py,sha256=
|
|
7
|
-
pyezvizapi/constants.py,sha256=
|
|
6
|
+
pyezvizapi/client.py,sha256=Bp5eQbn4-pjsZicfpWy6jD5bDjQeYFw-SN1p0uzKJRY,71782
|
|
7
|
+
pyezvizapi/constants.py,sha256=SqdJRQSRdVYQxMgJa__AgorzdWglgA4MM4H2fq3QLAE,12633
|
|
8
8
|
pyezvizapi/exceptions.py,sha256=8rmxEUQdrziqMe-M1SeeRd0HtP2IDQ2xpJVj7wvOQyo,976
|
|
9
9
|
pyezvizapi/light_bulb.py,sha256=9wgycG3dTvBbrsxQjQnXal-GA8VXPsIN1m-CTtRh8i0,7797
|
|
10
10
|
pyezvizapi/models.py,sha256=NQzwTP0yEe2IWU-Vc6nAn87xulpTuo0MX2Rcf0WxifA,4176
|
|
@@ -12,10 +12,10 @@ pyezvizapi/mqtt.py,sha256=aOL-gexZgYvCCaNQ03M4vZan91d5p2Fl_qsFykn9NW4,22365
|
|
|
12
12
|
pyezvizapi/test_cam_rtsp.py,sha256=WGSM5EiOTl_r1mWHoMb7bXHm_BCn1P9X_669YQ38r6k,4903
|
|
13
13
|
pyezvizapi/test_mqtt.py,sha256=Orn-fwZPJIE4G5KROMX0MRAkLwU6nLb9LUtXyb2ZCQs,4147
|
|
14
14
|
pyezvizapi/utils.py,sha256=o342o3LI9eP8qla1vXM2rqlVbdTiLK0dAqrkyUSXpg8,5939
|
|
15
|
-
pyezvizapi-1.0.1.
|
|
16
|
-
pyezvizapi-1.0.1.
|
|
17
|
-
pyezvizapi-1.0.1.
|
|
18
|
-
pyezvizapi-1.0.1.
|
|
19
|
-
pyezvizapi-1.0.1.
|
|
20
|
-
pyezvizapi-1.0.1.
|
|
21
|
-
pyezvizapi-1.0.1.
|
|
15
|
+
pyezvizapi-1.0.2.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
16
|
+
pyezvizapi-1.0.2.1.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
17
|
+
pyezvizapi-1.0.2.1.dist-info/METADATA,sha256=7bfpp78cETKjTT4kfylOsfEqxiLFRBJ2w8X8tcalz5Y,695
|
|
18
|
+
pyezvizapi-1.0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
+
pyezvizapi-1.0.2.1.dist-info/entry_points.txt,sha256=_BSJ3eNb2H_AZkRdsv1s4mojqWn3N7m503ujvg1SudA,56
|
|
20
|
+
pyezvizapi-1.0.2.1.dist-info/top_level.txt,sha256=gMZTelIi8z7pXyTCQLLaIkxVRrDQ_lS2NEv0WgfHrHs,11
|
|
21
|
+
pyezvizapi-1.0.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|