-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
Anyone (@shauntarves) know if the URL/URI changed? Neither "https://api.wyze.com/v2/devices" or "https://api.wyzecam.com/app/devices/list" work with the SDK to list all active cameras.
My code:
def get_all_camera_statuses(access_token):
"""Fetches the status of all Wyze cameras."""
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json",
}
payload = {}
response = requests.post(DEVICE_LIST_URL, headers=headers, json=payload)
print(f"[DEBUG] Response status code: {response.status_code}")
print(f"[DEBUG] Raw response text: {response.text}") # Print raw response for debugging
if response.status_code == 200 and response.text:
devices = response.json().get("data", {}).get("device_list", [])
# Filter only cameras and get their connection status
camera_statuses = {device.get("nickname"): device.get("connection")
for device in devices if device.get("product_type") == "Camera"}
if camera_statuses:
print(f"[INFO] Retrieved camera statuses: {camera_statuses}")
else:
print("[WARNING] No cameras found among the devices.")
return camera_statuses
else:
print(f"[ERROR] Failed to fetch camera statuses. Status code: {response.status_code}")
return {}
Metadata
Metadata
Assignees
Labels
No labels