amimof / huego

An extensive Philips Hue client library for Go with an emphasis on simplicity
MIT License
250 stars 36 forks source link

added UniqueID for sensors #10

Closed bboehmke closed 5 years ago

bboehmke commented 5 years ago

Added missing unique ID of sensors.

See https://developers.meethue.com/develop/hue-api/5-sensors-api/

amimof commented 5 years ago

Thanks for contributing. Changes looks good 👏

barrebre commented 5 years ago

Hey, I have a question about this - I forked the repo and then tried to go test, but it fails due to missing a sensor property, which you've included.

I can see all of the other properties populate, but not that one. Any idea why? image

/Users/barrebre/go/src/github.com/barrebre/huego/sensor_test.go:25:32: sensor.UniqueID undefined (type huego.Sensor has no field or method UniqueID)
/Users/barrebre/go/src/github.com/barrebre/huego/sensor_test.go:45:31: sensor.UniqueID undefined (type *huego.Sensor has no field or method UniqueID)
/Users/barrebre/go/src/github.com/barrebre/huego/sensor_test.go:93:32: sensor.UniqueID undefined (type *huego.Sensor has no field or method UniqueID)
amimof commented 5 years ago

@barrebre I think it's because the tests are in a different package huego_test and therefor include "github.com/amimof/huego". It's kinda weird that way and I'm going to change it so it's easier to fork and contribute.

bboehmke commented 5 years ago

@barrebre Maybe I can help:

I suppose you cloned (or go get) the module inside the GOPATH. If this is the case the Go Modules are disabled by default (see https://github.com/golang/go/wiki/Modules#how-to-define-a-modul).

If you clone this repository outside of the GOPATH the test should work as expected.