Connection stability issues
### Homebridge UniFi Protect Version

v7.11.0

### Homebridge Platform and OS

macOS Sonoma 14.5 (23F79)

### Homebridge Version

v1.8.5

### Node Version

v22.13.1

### UniFi OS Version

4.1.13

### UniFi Protect Controller Version

5.2.42

### Describe the problem

After a while the plugin starts reporting errors in trying to communicate with UniFi Protect and says that it will pause trying for 5 mins. This is resolved with a reboot of home bridge.



### Homebridge HBUP JSON configuration

```json
{
    "bridge": {
        "name": "Homebridge 5F3E",
        "username": "****",
        "port": 51760,
        "pin": "****",
        "advertiser": "bonjour-hap"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "controllers": [
                {
                    "address": "192.168.0.1",
                    "password": "****",
                    "username": "****"
                }
            ],
            "name": "UniFi Protect",
            "options": [
                "Enable.Device.SyncName.9C05D6A04A4D",
                "Enable.Video.Transcode.Hardware.9C05D6A04A4D",
                "Disable.Doorbell.Messages",
                "Disable.Log.Doorbell",
                "Disable.Video.Transcode",
                "Disable.Video.Transcode.HighLatency",
                "Disable.Doorbell.Messages.9C05D6A04A4D",
                "Disable.Log.Doorbell.9C05D6A04A4D",
                "Disable.Video.Transcode.9C05D6A04A4D",
                "Disable.Video.Transcode.HighLatency.9C05D6A04A4D",
                "Disable.Log.Doorbell.AC8BA90DD880",
                "Disable.Video.Transcode.AC8BA90DD880",
                "Disable.Video.Transcode.HighLatency.AC8BA90DD880",
                "Enable.Video.Transcode.Hardware.AC8BA90DD880",
                "Enable.Device.SyncName.70A7418FD7F5",
                "Disable.Log.Doorbell.70A7418FD7F5",
                "Enable.Video.Transcode.Hardware.70A7418FD7F5",
                "Enable.Video.Transcode.70A7418FD7F5",
                "Enable.Video.Transcode.HighLatency.70A7418FD7F5"
            ],
            "platform": "UniFi Protect",
            "_bridge": {
                "username": "****",
                "port": 31104
            }
        },
        {
            "name": "Sonos",
            "alarms": true,
            "forceS2": true,
            "service": "switch",
            "speakers": false,
            "platform": "ZP"
        },
        {
            "name": "Virtual Accessories Platform",
            "devices": [
                {
                    "accessoryID": "GrgWin1",
                    "accessoryName": "Windows",
                    "accessoryType": "windowcovering",
                    "windowCoveringDefaultState": "closed",
                    "transitionDuration": 30,
                    "accessoryIsStateful": true
                }
            ],
            "platform": "VirtualAccessoriesForHomebridge",
            "_bridge": {
                "username": "****",
                "port": 43060
            }
        }
    ],
    "disabledPlugins": [
        "homebridge-zp"
    ]
}
```

### Relevant log output

```shell
[1/29/2025, 6:23:58 AM] [UniFi Protect] Using FFmpeg version: 7.0.2-homebridge-darwin-arm64.
(node:3914) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
(Use `node --trace-deprecation ...` to show where the warning was created)
[1/29/2025, 6:23:59 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: Connected to 192.168.0.1 (UniFi Protect 5.2.42 running on UniFi OS 4.1.13).
[1/29/2025, 6:23:59 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: Discovered nvr: Dream Machine Pro Max [UDM Pro Max] (address: 192.168.0.1 mac: 9C05D6A04A4D).
[1/29/2025, 6:23:59 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: Discovered camera: G5 PTZ [G5 PTZ] (address: 192.168.0.58 mac: 28704E176749).
[1/29/2025, 6:23:59 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: Discovered camera: G5 Dome [G5 Dome] (address: 192.168.0.56 mac: 70A7418FD7F5).
[1/29/2025, 6:23:59 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: Discovered camera: G5 Bullet [G5 Bullet] (address: 192.168.0.218 mac: AC8BA90DD880).
[1/29/2025, 6:23:59 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: Syncing Protect device names to HomeKit.
[1/29/2025, 6:23:59 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: Hardware-accelerated decoding and transcoding enabled.
[1/29/2025, 7:24:03 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[1/29/2025, 7:24:06 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[1/29/2025, 7:24:09 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[1/29/2025, 7:24:16 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[1/29/2025, 7:24:16 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: API error: Unable to retrieve the UniFi Protect controller configuration.
[1/29/2025, 7:24:33 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[1/29/2025, 7:24:40 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[1/29/2025, 7:24:40 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: API error: Unable to retrieve the UniFi Protect controller configuration.
[1/29/2025, 7:24:57 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[1/29/2025, 7:25:03 AM] [UniFi Protect] Dream Machine Pro Max [UDMPROMAX]: API error: Throttling API calls due to errors with the 10 previous attempts. Pausing communication with the Protect controller for 5 minutes.
[1/29/2025, 7:25:04 AM] [UniFi Protect] 192.168.0.1: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[1/29/2025, 7:30:04 AM] [UniFi Protect] 192.168.0.1: API error: Resuming connectivity to the UniFi Protect API after pausing for 5 minutes.
```

### Acknowledgment that you are only running UniFi OS and UniFi Protect releases from the Ubiquiti Official release channel

- [x] I acknowledge that I am not running any early access / beta firmwares or operating systems from either Ubiquiti or Apple.