-
Notifications
You must be signed in to change notification settings - Fork 0
/
aircomfort.go
32 lines (28 loc) · 998 Bytes
/
aircomfort.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package tado
import (
"context"
"net/http"
"time"
)
// AirComfort contains the air comfort for a home. This contains the overall air freshness for the house, along with details for each zone.
type AirComfort struct {
Freshness struct {
Value string `json:"value"`
LastOpenWindow time.Time `json:"lastOpenWindow"`
} `json:"freshness"`
Comfort []ZoneAirComfort `json:"comfort"`
}
// ZoneAirComfort contains the air comfort for one zone in the home
type ZoneAirComfort struct {
RoomID int `json:"roomId"`
TemperatureLevel string `json:"temperatureLevel"`
HumidityLevel string `json:"humidityLevel"`
Coordinate struct {
Radial float64 `json:"radial"`
Angular int `json:"angular"`
} `json:"coordinate"`
}
// GetAirComfort returns the AirComfort for the active Home
func (c *APIClient) GetAirComfort(ctx context.Context) (airComfort AirComfort, err error) {
return callAPI[AirComfort](ctx, c, http.MethodGet, "myTado", "/airComfort", nil)
}