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

View File

@@ -17,18 +17,20 @@ cp .env.example .env
```
```env
HOST=192.168.1.1 # UniFi controller IP
API_KEY= # API key from UniFi OS profile → API Tokens
HOST=192.168.1.1 # UniFi controller IP
API_KEY= # API key from UniFi OS profile → API Tokens
UNIFI_USERNAME= # Local UniFi OS username (for speaker volume control)
UNIFI_PASSWORD= # Local UniFi OS password
```
## API Reference
[UniFi Protect API v6.2.88](https://developer.ui.com/protect/v6.2.88)
> **Note:** For use cases requiring real-time event subscriptions (WebSocket),
speaker volume control, or access to settings not exposed by the official API,
consider [uiprotect](https://github.com/uilibs/uiprotect) — an unofficial Python
library wrapping the private UniFi Protect API.
> **Note:** For use cases requiring real-time event subscriptions (WebSocket) or
access to settings not exposed by the official API, consider
[uiprotect](https://github.com/uilibs/uiprotect) — an unofficial Python library
wrapping the private UniFi Protect API.
## Run