pyezvizapi 1.0.1.9__tar.gz → 1.0.2.1__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.

Files changed (27) hide show
  1. {pyezvizapi-1.0.1.9/pyezvizapi.egg-info → pyezvizapi-1.0.2.1}/PKG-INFO +1 -1
  2. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/client.py +17 -11
  3. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/constants.py +1 -0
  4. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1/pyezvizapi.egg-info}/PKG-INFO +1 -1
  5. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/setup.py +1 -1
  6. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/LICENSE +0 -0
  7. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/LICENSE.md +0 -0
  8. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/MANIFEST.in +0 -0
  9. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/README.md +0 -0
  10. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/__init__.py +0 -0
  11. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/__main__.py +0 -0
  12. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/api_endpoints.py +0 -0
  13. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/camera.py +0 -0
  14. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/cas.py +0 -0
  15. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/exceptions.py +0 -0
  16. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/light_bulb.py +0 -0
  17. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/models.py +0 -0
  18. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/mqtt.py +0 -0
  19. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/test_cam_rtsp.py +0 -0
  20. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/test_mqtt.py +0 -0
  21. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi/utils.py +0 -0
  22. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi.egg-info/SOURCES.txt +0 -0
  23. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi.egg-info/dependency_links.txt +0 -0
  24. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi.egg-info/entry_points.txt +0 -0
  25. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi.egg-info/requires.txt +0 -0
  26. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/pyezvizapi.egg-info/top_level.txt +0 -0
  27. {pyezvizapi-1.0.1.9 → pyezvizapi-1.0.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyezvizapi
3
- Version: 1.0.1.9
3
+ Version: 1.0.2.1
4
4
  Summary: Pilot your Ezviz cameras
5
5
  Home-page: https://github.com/RenierM26/pyEzvizApi/
6
6
  Author: Renier Moorcroft
@@ -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
- next_page = json_output["page"].get("hasNext", False)
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["deviceInfos"]:
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
- result[_serial]["deviceInfos"]["supportExt"] = json.loads(
1099
- result[_serial]["deviceInfos"]["supportExt"]
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:
@@ -464,3 +464,4 @@ class DeviceCatagories(Enum):
464
464
  BASE_STATION_DEVICE_CATEGORY = "XVR"
465
465
  CAT_EYE_CATEGORY = "CatEye"
466
466
  LIGHTING = "lighting"
467
+ W2H_BASE_STATION_DEVICE_CATEGORY = "IGateWay" # @emeric699 Adding support for W2H Base Station
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyezvizapi
3
- Version: 1.0.1.9
3
+ Version: 1.0.2.1
4
4
  Summary: Pilot your Ezviz cameras
5
5
  Home-page: https://github.com/RenierM26/pyEzvizApi/
6
6
  Author: Renier Moorcroft
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name='pyezvizapi',
8
- version="1.0.1.9",
8
+ version="1.0.2.1",
9
9
  license='Apache Software License 2.0',
10
10
  author='Renier Moorcroft',
11
11
  author_email='RenierM26@users.github.com',
File without changes
File without changes
File without changes
File without changes
File without changes