Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Support controllers on UniFi OS #19

Open
mannkind opened this issue Jan 10, 2021 · 1 comment
Open

[FEATURE REQUEST] Support controllers on UniFi OS #19

mannkind opened this issue Jan 10, 2021 · 1 comment

Comments

@mannkind
Copy link

Is your feature request related to a problem? Please describe.
This library fails to work with controllers running on UniFi OS due to the way URLs have changed.

Describe the solution you'd like
I'd like this library to work with both controllers hosted in the standard way and controllers running on UniFi OS.

Describe alternatives you've considered
Uhhh, I guess switching to a different library? :) This seems to be the best one.

Additional context
Hello!

I maintain a little app called unifi2mqtt that utilizes your library in order to facilitate presence detection in my home automation setup. Much to my surprise there are a few other people using it -- or at least wanting to use it -- and they've reported that it does not work with controllers running on UniFi OS.

Now that I have a Cloud Key Plus, I thought I'd take an initial swing at modifying your library to work with controllers running on UniFi OS. I've already made some changes that can be found at my fork, but I thought I'd start with a feature request instead of diving right into a PR.

"Detection" of UniFi OS is done via the HTTP status code of the base URL, which appears to be what unifi libraries in other languages are doing.

Six of the ten integration tests are passing, but functionality like renaming a client or blocking a guest are currently failing. The controller returns an HTTP404 even though it appears to be the correctly mapped URL and payload. I'm not really sure what to make of that. Thus I've modified the test to return inconclusive when running against a controller on UniFi OS.

Should you be interested in supporting controllers running on UniFi OS, but don't wish to use a PR from my fork directly, feel free to copypasta whatever you want.

Thanks for your time!

@mannkind mannkind added the Reviewing Item is being reviewed label Jan 10, 2021
@KoenZomers
Copy link
Owner

Thanks for your comment! Surely don't mind supporting them as well. I don't have access to one unfortunately so can't implement it myself. Feel free to file a PR which enables using it against the UniFi controllers from Ubiquiti as well and I'll be happy to review and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants