Skip to content

Commit

Permalink
Fix configuration handling
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanwichmann committed Apr 16, 2017
1 parent 653e96c commit aff4f58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const hueBridgeAppName = "kelvin"
// InitializeBridge creates and returns an initialized HueBridge.
// If you have a valid configuration this will be used. Otherwise a local
// discovery will be started, followed by a user registration on your bridge.
func InitializeBridge(configuration Configuration) (HueBridge, error) {
func InitializeBridge(configuration *Configuration) (HueBridge, error) {
var bridge HueBridge
bridge.ignoredDeviceIDs = configuration.IgnoredDeviceIDs

Expand Down
4 changes: 2 additions & 2 deletions kelvin.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func main() {
}

// find bridge
bridge, err := InitializeBridge(configuration)
bridge, err := InitializeBridge(&configuration)
if err != nil {
log.Fatal(err)
}
Expand All @@ -58,7 +58,7 @@ func main() {
}

// find location
_, err = InitializeLocation(configuration)
_, err = InitializeLocation(&configuration)
if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion location.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Geolocation struct {
const geolocationURL = "https://freegeoip.net/json/"

// InitializeLocation creates and return a geolocation for the current system.
func InitializeLocation(configuration Configuration) (Geolocation, error) {
func InitializeLocation(configuration *Configuration) (Geolocation, error) {
var location Geolocation
if configuration.Location.Latitude == 0 || configuration.Location.Longitude == 0 {
log.Println("🌍 Location not configured. Detecting by IP")
Expand Down

0 comments on commit aff4f58

Please sign in to comment.