Skip to content

Conversation

@mitchellrj
Copy link

Builds on #13 but adds support for motion sensors and generic sensors.

Verified against Hue Bridge Daylight Sensor, Hue Dimmer Switch, Hue Tap Switch, Hue Motion Sensor and API-created sensors.

sensorList := map[string]Sensor{}
err = json.Unmarshal(body, &sensorList)
if err != nil {
fmt.Print(err)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Printing the error is probably not what should be done by default, just returning it should be fine. Maybe include it in the errors.New() below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

/*
* sensor.go
* GoHue library for Philips Hue
* Copyright (C) 2016 Collin Guarino (Collinux) [email protected]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new file, so you probably can have your own copyright information here. At least the year should be current.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just copied from #13 so, probably @bboehmke's details should go there :)

@rogierlommers
Copy link

Any change of merging this? I need the sensor temperatures :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants