pyezvizapi 1.0.3.4__tar.gz → 1.0.3.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.3.4/pyezvizapi.egg-info → pyezvizapi-1.0.3.6}/PKG-INFO +1 -1
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/__init__.py +6 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/client.py +30 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/feature.py +69 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6/pyezvizapi.egg-info}/PKG-INFO +1 -1
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/setup.py +1 -1
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/LICENSE +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/LICENSE.md +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/MANIFEST.in +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/README.md +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/__main__.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/api_endpoints.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/camera.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/cas.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/constants.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/exceptions.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/light_bulb.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/models.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/mqtt.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/test_cam_rtsp.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/test_mqtt.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi/utils.py +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi.egg-info/SOURCES.txt +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi.egg-info/dependency_links.txt +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi.egg-info/entry_points.txt +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi.egg-info/requires.txt +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/pyezvizapi.egg-info/top_level.txt +0 -0
- {pyezvizapi-1.0.3.4 → pyezvizapi-1.0.3.6}/setup.cfg +0 -0
|
@@ -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
|
]
|
|
@@ -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,
|
|
@@ -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
|
|
|
@@ -287,6 +329,33 @@ def display_mode_value(camera_data: Mapping[str, Any]) -> int:
|
|
|
287
329
|
return 1
|
|
288
330
|
|
|
289
331
|
|
|
332
|
+
def blc_current_value(camera_data: Mapping[str, Any]) -> int:
|
|
333
|
+
"""Return BLC position (0..5) from camera data. 0 = Off."""
|
|
334
|
+
optionals = optionals_mapping(camera_data)
|
|
335
|
+
inverse_mode = optionals.get("inverse_mode")
|
|
336
|
+
inverse_mode = decode_json(inverse_mode)
|
|
337
|
+
|
|
338
|
+
# Expected: {"mode": int, "enable": 0|1, "position": 0..5}
|
|
339
|
+
if isinstance(inverse_mode, Mapping):
|
|
340
|
+
enable = inverse_mode.get("enable", 0)
|
|
341
|
+
position = inverse_mode.get("position", 0)
|
|
342
|
+
if (
|
|
343
|
+
isinstance(enable, int)
|
|
344
|
+
and enable == 1
|
|
345
|
+
and isinstance(position, int)
|
|
346
|
+
and position in (1, 2, 3, 4, 5)
|
|
347
|
+
):
|
|
348
|
+
return position
|
|
349
|
+
return 0
|
|
350
|
+
|
|
351
|
+
# Fallbacks if backend ever returns a bare int (position) instead of the object
|
|
352
|
+
if isinstance(inverse_mode, int) and inverse_mode in (0, 1, 2, 3, 4, 5):
|
|
353
|
+
return inverse_mode
|
|
354
|
+
|
|
355
|
+
# Default to Off
|
|
356
|
+
return 0
|
|
357
|
+
|
|
358
|
+
|
|
290
359
|
def device_icr_dss_config(camera_data: Mapping[str, Any]) -> dict[str, Any]:
|
|
291
360
|
"""Decode and return the device_ICR_DSS configuration."""
|
|
292
361
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|