Made the url used to check the token a config option
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-11-22 03:33:00 +01:00
parent 501775654f
commit 6f5b3d13f7
5 changed files with 14 additions and 9 deletions

View File

@@ -19,7 +19,7 @@ type Home struct {
}
// Auto populate and update the device list
func New(username string, credentials config.Credentials) *Home {
func New(username string, credentials config.Credentials, oauthUrl string) *Home {
home := &Home{Username: username, Devices: make(map[device.InternalName]device.Basic)}
homegraphService, err := homegraph.NewService(context.Background(), option.WithCredentialsJSON(credentials))
@@ -27,7 +27,7 @@ func New(username string, credentials config.Credentials) *Home {
panic(err)
}
home.Service = google.NewService(home, homegraphService)
home.Service = google.NewService(home, homegraphService, oauthUrl)
return home
}