arlo-go/cmd/main.go

37 lines
588 B
Go
Raw Normal View History

2020-05-27 08:49:40 +00:00
package main
import (
"context"
2020-05-27 11:35:02 +00:00
2020-05-27 08:49:40 +00:00
"git.lehouerou.net/laurent/arlo-go"
log "github.com/sirupsen/logrus"
)
func main() {
a := arlo.NewArlo()
err := a.Login(context.Background(), "hass@lehouerou.net", "TiPXMVLUeZfUg6RrmwzK")
if err != nil {
log.Errorf("login: %v", err)
return
}
for _, device := range a.Cameras {
log.Infof("%s", device.DeviceName)
}
for _, b := range a.Basestations {
2020-05-27 11:35:02 +00:00
_, err := b.GetModes()
if err != nil {
log.Error(err)
}
log.Info("ok")
err = b.DeleteMode("mode5")
2020-05-27 08:49:40 +00:00
if err != nil {
log.Error(err)
}
log.Info("ok")
}
select {}
}