fix speaker volume control and auth

- Rename USERNAME/PASSWORD to UNIFI_USERNAME/UNIFI_PASSWORD to avoid
  conflict with the Windows USERNAME system environment variable
- Set both speakerSettings.volume and speakerSettings.speakerVolume
  in the PATCH request
- Log volume before and after the change to verify it took effect
This commit is contained in:
2026-03-01 05:13:32 +01:00
parent 20cc348995
commit 3a60ea5cb7
6 changed files with 116 additions and 14 deletions

29
dump_camera.py Normal file
View File

@@ -0,0 +1,29 @@
import json
import os
import httpx
from dotenv import load_dotenv
load_dotenv()
BASE = f"https://{os.environ['HOST']}/proxy/protect/integration/v1"
HEADERS = {"X-API-Key": os.environ["API_KEY"]}
CAMERA_NAME = "G6 Pro 360"
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 CAMERA_NAME in c["name"])
print("=== Camera ===")
data = client.get(f"{BASE}/cameras/{camera['id']}").raise_for_status().json()
print(json.dumps(data, indent=2))
print("\n=== Sensors ===")
sensors = client.get(f"{BASE}/sensors").raise_for_status().json()
print(json.dumps(sensors, indent=2))
if __name__ == "__main__":
main()