24 lines
639 B
Python
24 lines
639 B
Python
import os
|
|
|
|
import httpx
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
API_KEY = os.environ["API_KEY"]
|
|
HOST = os.environ["HOST"]
|
|
BASE = f"https://{HOST}/proxy/protect/integration/v1"
|
|
HEADERS = {"Accept": "application/json", "X-API-Key": API_KEY}
|
|
|
|
|
|
def main():
|
|
with httpx.Client(headers=HEADERS, verify=False) as client:
|
|
cameras = client.get(f"{BASE}/cameras").raise_for_status().json()
|
|
camera = next(c for c in cameras if "G6 Pro 360" in c["name"])
|
|
print(f"Camera: {camera['name']} ({camera['id']})")
|
|
print(f"Has speaker: {camera['featureFlags']['hasSpeaker']}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|