unificontrol icon indicating copy to clipboard operation
unificontrol copied to clipboard

UniFiOS API now very slow since UDM firmware 1.11

Open stevehoek opened this issue 3 years ago • 2 comments

I've been using the UDMsupport branch of this library in my project and it has been working great, up to and including UniFiOS 1.10 However, since upgrading this week to 1.11 the API calls are all taking much longer to return... device list, client list, client detail.

Is anyone else experiencing this?

stevehoek avatar Dec 23 '21 16:12 stevehoek

yes, I'm seeing this too.

clyra avatar Dec 30 '21 21:12 clyra

I'm trying to figure out what's happening but so far didnt had success. I'm also comparing this library to the one used by home-assistant (https://github.com/Kane610/aiounifi) and it seems that when the device is using the "unifi-os" you need to send the x-csrf-token (https://github.com/Kane610/aiounifi/blob/cb9f72c616706c078b8c84b3e822e2a223636a33/aiounifi/controller.py#L105).

So I added a self.headers variable to unificlient class and added this to the _execute:

        token = resp.headers.get("x-csrf-token")
        if not self.headers.get("x-csrf-token") and token:
            self.headers["x-csrf-token"] = token

but even with that, it still takes 60 seconds to get a reply (which I find very suspicious... is it some sort of timeout?).

clyra avatar Jan 02 '22 17:01 clyra