Unifi-Python-API icon indicating copy to clipboard operation
Unifi-Python-API copied to clipboard

Added new routes based on the resources provided. Refactored "get" re…

Open odgrace opened this issue 5 years ago • 0 comments

Hi!

I found the library looked a little like what i was after, so i decided to contribute a bit. My first pull request ever - apologies if i have probably changed too much for one single commit. A few pointers:

  • Added 4 new routes based on some API docs. Have tested all with my controller and they seem to work.
  • I refactored all "GET" requests - seemed to be repeating a lot otherwise
  • I have avoided doing filters like you did in "list_clients" - i figure this library is great if you deal with the filtering outside the API
  • you can set verify_ssl globally to a session object so i did that. I'm assuming that a single API object will be made per site - and if the site has proper SSL then you'd only need to set the param once. Thoughts?
  • Also did a few PEP-8 formatting.

The json files are simply transcribing from the API docs site i was using. Eventually i'd make lookups based on these files.

odgrace avatar Mar 17 '19 23:03 odgrace