- Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution, and typed accessors for sites, clients, devices, networks, and routes - Add CLI commands: unifi sites, clients, devices, networks, routes, config - Register unifi commands in full variant build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
17 lines
347 B
Go
17 lines
347 B
Go
package unifi
|
|
|
|
import (
|
|
uf "github.com/unpoller/unifi/v5"
|
|
|
|
"github.com/host-uk/core/pkg/log"
|
|
)
|
|
|
|
// GetSites returns all sites from the UniFi controller.
|
|
func (c *Client) GetSites() ([]*uf.Site, error) {
|
|
sites, err := c.api.GetSites()
|
|
if err != nil {
|
|
return nil, log.E("unifi.GetSites", "failed to fetch sites", err)
|
|
}
|
|
|
|
return sites, nil
|
|
}
|