Permalink
Browse files

implement: /devices (cloud api) corresponds to illuminance

  • Loading branch information...
papix committed Jun 30, 2018
1 parent 9c28939 commit 1d6b79aed6e297da5fd1884a383aafb055650ebd
Showing with 4 additions and 8 deletions.
  1. +4 −8 cloud/device.go
@@ -17,20 +17,16 @@ type Device struct {
}

type NewestEvents struct {
Temperature Temperature `json:"te"`
Humidity Humidity `json:"hu"`
Temperature SensorValue `json:"te"`
Humidity SensorValue `json:"hu"`
Illuminance SensorValue `json:"il"`
}

type Temperature struct {
type SensorValue struct {
Value float64 `json:"val"`
CreatedAt string `json:"created_at"`
}

type Humidity struct {
Value int32 `json:"val"`
CreatedAt string `json:"created_at"`
}

func (c *Client) GetDevices() ([]*Device, error) {
req, err := http.NewRequest("GET", c.urlFor("/devices").String(), nil)
if err != nil {

0 comments on commit 1d6b79a

Please sign in to comment.