unpoller / unifi

Go Library (w/ structures) to grab data from a Ubitquiti UniFi Controller
https://golift.io/discord
MIT License
114 stars 22 forks source link

Add support for controller 5.11 json data. #23

Closed davidnewhall closed 5 years ago

davidnewhall commented 5 years ago

Split the Stat piece of each device's struct out to a hidden struct that is exported by another struct. Not too complicated, but it allows unmarshaling the data from either controller format into the same structure we've always had. Closes https://github.com/davidnewhall/unifi-poller/issues/47

Support for the new controller format doesn't change any interfaces, but the Server() interface was deliberately augmented. It now purposely returns an unexported type. It will be removed in a future version of this library since the controller version is now stored in the returned Unifi structure.

It's a little easier to look at without white space changes. The build failing is okay. It's failing two lint checks. One of which is a bug in the linter (report opened) and the other refers to the Server changes mentioned above that will be removed later.

TODO: