pyezvizapi 1.0.3.5__py3-none-any.whl → 1.0.3.6__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/__init__.py +6 -0
- pyezvizapi/client.py +30 -0
- pyezvizapi/feature.py +42 -0
- {pyezvizapi-1.0.3.5.dist-info → pyezvizapi-1.0.3.6.dist-info}/METADATA +1 -1
- {pyezvizapi-1.0.3.5.dist-info → pyezvizapi-1.0.3.6.dist-info}/RECORD +10 -10
- {pyezvizapi-1.0.3.5.dist-info → pyezvizapi-1.0.3.6.dist-info}/WHEEL +0 -0
- {pyezvizapi-1.0.3.5.dist-info → pyezvizapi-1.0.3.6.dist-info}/entry_points.txt +0 -0
- {pyezvizapi-1.0.3.5.dist-info → pyezvizapi-1.0.3.6.dist-info}/licenses/LICENSE +0 -0
- {pyezvizapi-1.0.3.5.dist-info → pyezvizapi-1.0.3.6.dist-info}/licenses/LICENSE.md +0 -0
- {pyezvizapi-1.0.3.5.dist-info → pyezvizapi-1.0.3.6.dist-info}/top_level.txt +0 -0
pyezvizapi/__init__.py
CHANGED
|
@@ -57,6 +57,9 @@ from .feature import (
|
|
|
57
57
|
port_security_has_port,
|
|
58
58
|
port_security_port_enabled,
|
|
59
59
|
resolve_channel,
|
|
60
|
+
supplement_light_available,
|
|
61
|
+
supplement_light_enabled,
|
|
62
|
+
supplement_light_params,
|
|
60
63
|
support_ext_value,
|
|
61
64
|
)
|
|
62
65
|
from .light_bulb import EzvizLightBulb
|
|
@@ -118,5 +121,8 @@ __all__ = [
|
|
|
118
121
|
"port_security_has_port",
|
|
119
122
|
"port_security_port_enabled",
|
|
120
123
|
"resolve_channel",
|
|
124
|
+
"supplement_light_available",
|
|
125
|
+
"supplement_light_enabled",
|
|
126
|
+
"supplement_light_params",
|
|
121
127
|
"support_ext_value",
|
|
122
128
|
]
|
pyezvizapi/client.py
CHANGED
|
@@ -1615,6 +1615,35 @@ class EzvizClient:
|
|
|
1615
1615
|
error_message="Could not fetch device feature value",
|
|
1616
1616
|
)
|
|
1617
1617
|
|
|
1618
|
+
def set_intelligent_fill_light(
|
|
1619
|
+
self,
|
|
1620
|
+
serial: str,
|
|
1621
|
+
*,
|
|
1622
|
+
enabled: bool,
|
|
1623
|
+
local_index: str = "1",
|
|
1624
|
+
max_retries: int = 0,
|
|
1625
|
+
) -> dict:
|
|
1626
|
+
"""Toggle the intelligent fill light mode via the IoT feature API."""
|
|
1627
|
+
|
|
1628
|
+
payload = {
|
|
1629
|
+
"value": {
|
|
1630
|
+
"enabled": bool(enabled),
|
|
1631
|
+
"supplementLightSwitchMode": "eventIntelligence"
|
|
1632
|
+
if enabled
|
|
1633
|
+
else "irLight",
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
body = self._normalize_json_payload(payload)
|
|
1637
|
+
return self.set_iot_feature(
|
|
1638
|
+
serial,
|
|
1639
|
+
resource_identifier="Video",
|
|
1640
|
+
local_index=local_index,
|
|
1641
|
+
domain_id="SupplementLightMgr",
|
|
1642
|
+
action_id="ImageSupplementLightModeSwitchParams",
|
|
1643
|
+
value=body,
|
|
1644
|
+
max_retries=max_retries,
|
|
1645
|
+
)
|
|
1646
|
+
|
|
1618
1647
|
def set_image_flip_iot(
|
|
1619
1648
|
self,
|
|
1620
1649
|
serial: str,
|
|
@@ -2074,6 +2103,7 @@ class EzvizClient:
|
|
|
2074
2103
|
# Create camera object
|
|
2075
2104
|
cam = EzvizCamera(self, device, dict(rec.raw))
|
|
2076
2105
|
self._cameras[device] = cam.status(refresh=refresh)
|
|
2106
|
+
|
|
2077
2107
|
except (
|
|
2078
2108
|
PyEzvizError,
|
|
2079
2109
|
KeyError,
|
pyezvizapi/feature.py
CHANGED
|
@@ -24,6 +24,48 @@ def _feature_video_section(camera_data: Mapping[str, Any]) -> dict[str, Any]:
|
|
|
24
24
|
return {}
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
def supplement_light_params(camera_data: Mapping[str, Any]) -> dict[str, Any]:
|
|
28
|
+
"""Return SupplementLightMgr parameters if present."""
|
|
29
|
+
|
|
30
|
+
video = _feature_video_section(camera_data)
|
|
31
|
+
if not video:
|
|
32
|
+
return {}
|
|
33
|
+
|
|
34
|
+
manager: Any = video.get("SupplementLightMgr")
|
|
35
|
+
manager = decode_json(manager)
|
|
36
|
+
if not isinstance(manager, Mapping):
|
|
37
|
+
return {}
|
|
38
|
+
|
|
39
|
+
params: Any = manager.get("ImageSupplementLightModeSwitchParams")
|
|
40
|
+
params = decode_json(params)
|
|
41
|
+
return dict(params) if isinstance(params, Mapping) else {}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def supplement_light_enabled(camera_data: Mapping[str, Any]) -> bool:
|
|
45
|
+
"""Return True when intelligent fill light is enabled."""
|
|
46
|
+
|
|
47
|
+
params = supplement_light_params(camera_data)
|
|
48
|
+
if not params:
|
|
49
|
+
return False
|
|
50
|
+
|
|
51
|
+
enabled = params.get("enabled")
|
|
52
|
+
if isinstance(enabled, bool):
|
|
53
|
+
return enabled
|
|
54
|
+
if isinstance(enabled, str):
|
|
55
|
+
lowered = enabled.strip().lower()
|
|
56
|
+
if lowered in {"true", "1", "yes", "on"}:
|
|
57
|
+
return True
|
|
58
|
+
if lowered in {"false", "0", "no", "off"}:
|
|
59
|
+
return False
|
|
60
|
+
return bool(enabled)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def supplement_light_available(camera_data: Mapping[str, Any]) -> bool:
|
|
64
|
+
"""Return True when intelligent fill light parameters are present."""
|
|
65
|
+
|
|
66
|
+
return bool(supplement_light_params(camera_data))
|
|
67
|
+
|
|
68
|
+
|
|
27
69
|
def lens_defog_config(camera_data: Mapping[str, Any]) -> dict[str, Any]:
|
|
28
70
|
"""Return the LensCleaning defog configuration if present."""
|
|
29
71
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
pyezvizapi/__init__.py,sha256
|
|
1
|
+
pyezvizapi/__init__.py,sha256=-OxHqxA9h0JZQW__GoZd1aByGquIHawCnNdeNlIg2Qo,3382
|
|
2
2
|
pyezvizapi/__main__.py,sha256=9uttTuOfO22tzyomJIV8ebFJ-G-YUNDYOadZ_0AgdNA,20925
|
|
3
3
|
pyezvizapi/api_endpoints.py,sha256=2M5Vs4YB1VWZGcowT-4Fj2hhRNjFh976LT3jtRrqvrc,5754
|
|
4
4
|
pyezvizapi/camera.py,sha256=Pl5oIEdrFcv1Hz5sQI1IyyJIDCMjOjQdtExgKzmLoK8,22102
|
|
5
5
|
pyezvizapi/cas.py,sha256=3zHe-_a0KchCmGeAj1of-pV6oMPRUmSCIiDqBFsTK8A,6025
|
|
6
|
-
pyezvizapi/client.py,sha256=
|
|
6
|
+
pyezvizapi/client.py,sha256=LroaR4h_wYu8HB74l4_X6Vjq7rTiL88Idf18elUBj4A,141851
|
|
7
7
|
pyezvizapi/constants.py,sha256=5AxJYfof6NvebBcFvPkoKI6xinpkwmCnaauUvhvBMDY,12810
|
|
8
8
|
pyezvizapi/exceptions.py,sha256=8rmxEUQdrziqMe-M1SeeRd0HtP2IDQ2xpJVj7wvOQyo,976
|
|
9
|
-
pyezvizapi/feature.py,sha256=
|
|
9
|
+
pyezvizapi/feature.py,sha256=inqqk14Jgo3HOzml2GRUgz-hxbne4kT5iJ3L6SJhU8s,15990
|
|
10
10
|
pyezvizapi/light_bulb.py,sha256=9wgycG3dTvBbrsxQjQnXal-GA8VXPsIN1m-CTtRh8i0,7797
|
|
11
11
|
pyezvizapi/models.py,sha256=NQzwTP0yEe2IWU-Vc6nAn87xulpTuo0MX2Rcf0WxifA,4176
|
|
12
12
|
pyezvizapi/mqtt.py,sha256=aOL-gexZgYvCCaNQ03M4vZan91d5p2Fl_qsFykn9NW4,22365
|
|
13
13
|
pyezvizapi/test_cam_rtsp.py,sha256=O9NHh-vcNFfnzNw8jbuhM9a_5TWfNZIMXaJP7Lmkaj4,5162
|
|
14
14
|
pyezvizapi/test_mqtt.py,sha256=Orn-fwZPJIE4G5KROMX0MRAkLwU6nLb9LUtXyb2ZCQs,4147
|
|
15
15
|
pyezvizapi/utils.py,sha256=ozGncEyaIJJ8VYw8f-xfM2OBmqR8eNYLq728FFvbvr8,12757
|
|
16
|
-
pyezvizapi-1.0.3.
|
|
17
|
-
pyezvizapi-1.0.3.
|
|
18
|
-
pyezvizapi-1.0.3.
|
|
19
|
-
pyezvizapi-1.0.3.
|
|
20
|
-
pyezvizapi-1.0.3.
|
|
21
|
-
pyezvizapi-1.0.3.
|
|
22
|
-
pyezvizapi-1.0.3.
|
|
16
|
+
pyezvizapi-1.0.3.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
17
|
+
pyezvizapi-1.0.3.6.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
18
|
+
pyezvizapi-1.0.3.6.dist-info/METADATA,sha256=jp0jUC6j-BihBfzY79Qo_bdmk_yT6Db5wiJdlTHolmQ,695
|
|
19
|
+
pyezvizapi-1.0.3.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
20
|
+
pyezvizapi-1.0.3.6.dist-info/entry_points.txt,sha256=_BSJ3eNb2H_AZkRdsv1s4mojqWn3N7m503ujvg1SudA,56
|
|
21
|
+
pyezvizapi-1.0.3.6.dist-info/top_level.txt,sha256=gMZTelIi8z7pXyTCQLLaIkxVRrDQ_lS2NEv0WgfHrHs,11
|
|
22
|
+
pyezvizapi-1.0.3.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|