Bug in UniFi Protect Controller firmware v1.21.3 causing disconnect errors in the plugin.
<!-- BUG REPORTS THAT ARE NOT FILLED OUT COMPLETELY WILL BE CLOSED AUTOMATICALLY WITHOUT WARNING AND WILL NOT RECEIVE A RESPONSE. THE FORM IS HERE FOR A REASON. :). -->
<!-- Please ensure you read the documentation before creating a support request, especially the Troubleshooting page. -->
<!-- BUG REPORTS ABOUT BETA VERSIONS OF UNIFI / UBIQUITI FIRMWARE OR EARLY-ACCESS/BETA HARDWARE WILL BE CLOSED WITHOUT A RESPONSE. ALL BETA RELEASES FROM UBIQUITI ARE UNSUPPORTED -->

**Describe The Problem:**
Sometimes, it stops working (see logs). I have to restart the homebridge and then it starts working again

**To Reproduce:**
Don't know how to reproduce it. It just stops working after few hours of working.

**Logs:**
```
 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:38:52 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:38:52 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to retrieve a snapshot.
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1 Parkování [UVC G3]: Unable to retrieve a snapshot. 401 - Unauthorized.
[3/16/2022, 5:38:53 AM] [UniFi Protect] Invalid login credentials given. Please check your login and password.
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1: API endpoint access error
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1 Parkování [UVC G3]: Unable to start the timeshift buffer for HomeKit Secure Video.
[3/16/2022, 5:38:53 AM] [UniFi Protect] Invalid login credentials given. Please check your login and password.
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1: API endpoint access error
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1 Parkování [UVC G3]: Unable to start the timeshift buffer for HomeKit Secure Video.
[3/16/2022, 5:38:53 AM] [UniFi Protect] Invalid login credentials given. Please check your login and password.
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1: API endpoint access error
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[3/16/2022, 5:38:53 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to start the timeshift buffer for HomeKit Secure Video.
[3/16/2022, 5:38:54 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:38:54 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:39:06 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:39:06 AM] [UniFi Protect] 192.168.1.1 Vchod [UVC G3]: Unable to retrieve a snapshot.
[3/16/2022, 5:39:06 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:39:06 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:39:07 AM] [UniFi Protect] Invalid login credentials given. Please check your login and password.
[3/16/2022, 5:39:07 AM] [UniFi Protect] 192.168.1.1: API endpoint access error
[3/16/2022, 5:39:07 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[3/16/2022, 5:39:07 AM] [UniFi Protect] 192.168.1.1 Parkování [UVC G3]: Unable to start the timeshift buffer for HomeKit Secure Video.
[3/16/2022, 5:39:07 AM] [UniFi Protect] Invalid login credentials given. Please check your login and password.
[3/16/2022, 5:39:07 AM] [UniFi Protect] 192.168.1.1: API endpoint access error
[3/16/2022, 5:39:07 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[3/16/2022, 5:39:07 AM] [UniFi Protect] 192.168.1.1 Vchod [UVC G3]: Unable to start the timeshift buffer for HomeKit Secure Video.
[3/16/2022, 5:39:07 AM] [UniFi Protect] Invalid login credentials given. Please check your login and password.
[3/16/2022, 5:39:07 AM] [UniFi Protect] 192.168.1.1: API endpoint access error
[3/16/2022, 5:39:07 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[3/16/2022, 5:39:07 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to start the timeshift buffer for HomeKit Secure Video.
[3/16/2022, 5:39:08 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:39:08 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:39:10 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:39:19 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:39:19 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:39:22 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:39:22 AM] [UniFi Protect] 192.168.1.1 Vchod [UVC G3]: Unable to retrieve a snapshot.
[3/16/2022, 5:39:22 AM] [UniFi Protect] Invalid login credentials given. Please check your login and password.
[3/16/2022, 5:39:22 AM] [UniFi Protect] 192.168.1.1: API endpoint access error
[3/16/2022, 5:39:22 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[3/16/2022, 5:39:22 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to start the timeshift buffer for HomeKit Secure Video.
[3/16/2022, 5:39:23 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:39:33 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:39:33 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:39:36 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:39:36 AM] [UniFi Protect] 192.168.1.1 Vchod [UVC G3]: Unable to retrieve a snapshot.
[3/16/2022, 5:39:36 AM] [UniFi Protect] Invalid login credentials given. Please check your login and password.
[3/16/2022, 5:39:36 AM] [UniFi Protect] 192.168.1.1: API endpoint access error
[3/16/2022, 5:39:36 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[3/16/2022, 5:39:36 AM] [UniFi Protect] 192.168.1.1 Vchod [UVC G3]: Unable to start the timeshift buffer for HomeKit Secure Video.
[3/16/2022, 5:39:36 AM] [UniFi Protect] Invalid login credentials given. Please check your login and password.
[3/16/2022, 5:39:36 AM] [UniFi Protect] 192.168.1.1: API endpoint access error
[3/16/2022, 5:39:36 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[3/16/2022, 5:39:36 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to start the timeshift buffer for HomeKit Secure Video.
[3/16/2022, 5:39:37 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:39:37 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:39:45 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:39:46 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:39:46 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:39:47 AM] [UniFi Protect] Invalid login credentials given. Please check your login and password.
[3/16/2022, 5:39:47 AM] [UniFi Protect] 192.168.1.1: API endpoint access error
[3/16/2022, 5:39:47 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[3/16/2022, 5:39:47 AM] [UniFi Protect] 192.168.1.1 Vchod [UVC G3]: Unable to start the timeshift buffer for HomeKit Secure Video.
[3/16/2022, 5:39:47 AM] [UniFi Protect] Invalid login credentials given. Please check your login and password.
[3/16/2022, 5:39:47 AM] [UniFi Protect] 192.168.1.1: API endpoint access error
[3/16/2022, 5:39:47 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[3/16/2022, 5:39:47 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to start the timeshift buffer for HomeKit Secure Video.
[3/16/2022, 5:39:47 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:39:49 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:39:53 AM] [UniFi Protect] 192.168.1.1 Bouda [UVC G3 Instant]: Unable to turn the status light on. Please ensure this username has the Administrator role in UniFi Protect.
[3/16/2022, 5:40:00 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:40:00 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:40:14 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:40:14 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:40:28 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:40:28 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:40:41 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:40:41 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:40:55 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:40:55 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:41:09 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:41:09 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:41:23 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:41:23 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:41:36 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
[3/16/2022, 5:41:36 AM] [UniFi Protect] 192.168.1.1: Unable to retrieve NVR configuration information from UniFi Protect. Will retry again later.
[3/16/2022, 5:41:50 AM] [UniFi Protect] 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.
```

**Homebridge Configuration:**

```json
{
    "bridge": {
        "name": "Homebridge 8EDB",
        "username": "0E*****",
        "port": 51397,
        "pin": "884-50-***"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "controllers": [
                {
                    "address": "192.168.1.1",
                    "password": "***",
                    "username": "***"
                }
            ],
            "platform": "UniFi Protect"
        }
    ],
    "disabledPlugins": [
        "homebridge-irobot"
    ]
}
```

**Screenshots:**
not aplicable

**Environment:**

* **Homebridge Version:** 1.4.0
* **Node Version:** 16.14.0
* **Homebridge-UniFi-Protect Plugin Version:** 5.5.0
* **UniFi Protect Version:** 1.21.3
* **UniFi Protect Controller Type:** UDMPro
* **UniFi Protect Controller Firmware Version:** 1.12.13
* **Apple Device and iOS / macOS / iPadOS / tvOS Version:** iPhone 11 iOS 15.4
* **Operating System and OS Version:** Ubuntu 20.04.4 LTS

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->
