-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels_zone.go
67 lines (60 loc) · 1.81 KB
/
models_zone.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package tado
import (
"fmt"
"net/http"
"time"
)
// Zone contains info about a single zone
type Zone struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
DateCreated time.Time `json:"dateCreated"`
DeviceTypes []string `json:"deviceTypes"`
Devices []struct {
DeviceType string `json:"deviceType"`
SerialNo string `json:"serialNo"`
ShortSerialNo string `json:"shortSerialNo"`
CurrentFwVersion string `json:"currentFwVersion"`
ConnectionState struct {
Value bool `json:"value"`
Timestamp time.Time `json:"timestamp"`
} `json:"connectionState"`
Characteristics struct {
Capabilities []string `json:"capabilities"`
} `json:"characteristics"`
MountingState struct {
Value string `json:"value"`
Timestamp time.Time `json:"timestamp"`
} `json:"mountingState"`
BatteryState string `json:"batteryState"`
Duties []string `json:"duties"`
} `json:"devices"`
ReportAvailable bool `json:"reportAvailable"`
SupportsDazzle bool `json:"supportsDazzle"`
DazzleEnabled bool `json:"dazzleEnabled"`
DazzleMode struct {
Supported bool `json:"supported"`
Enabled bool `json:"enabled"`
} `json:"dazzleMode"`
OpenWindowDetection struct {
Supported bool `json:"supported"`
Enabled bool `json:"enabled"`
TimeoutInSeconds int `json:"timeoutInSeconds"`
} `json:"openWindowDetection"`
}
// GetZonesInput is the input for GetZones
type GetZonesInput struct {
HomeID int
}
func (gzi *GetZonesInput) method() string {
return http.MethodGet
}
func (gzi *GetZonesInput) path() string {
return fmt.Sprintf("/v2/homes/%d/zones", gzi.HomeID)
}
func (gzi *GetZonesInput) body() interface{} {
return nil
}
// GetZonesOutput is the output for GetZones
type GetZonesOutput []Zone