-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels_zonestate.go
108 lines (101 loc) · 3.23 KB
/
models_zonestate.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package tado
import (
"fmt"
"net/http"
"time"
)
// ZoneState is the state of a single zone
type ZoneState struct {
TadoMode string `json:"tadoMode"`
GeolocationOverride bool `json:"geolocationOverride"`
GeolocationOverrideDisableTime interface{} `json:"geolocationOverrideDisableTime"` // TODO
Preparation interface{} `json:"preparation"` // TODO
Setting struct {
Type string `json:"type"`
Power string `json:"power"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"setting"`
OverlayType string `json:"overlayType"`
Overlay struct {
Type string `json:"type"`
Setting struct {
Type string `json:"type"`
Power string `json:"power"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"setting"`
Termination struct {
Type string `json:"type"`
TypeSkillBasedApp string `json:"typeSkillBasedApp"`
DurationInSeconds int `json:"durationInSeconds"`
Expiry time.Time `json:"expiry"`
RemainingTimeInSeconds int `json:"remainingTimeInSeconds"`
ProjectedExpiry time.Time `json:"projectedExpiry"`
} `json:"termination"`
} `json:"overlay"`
OpenWindow interface{} `json:"openWindow"` // TODO
NextScheduleChange struct {
Start time.Time `json:"start"`
Setting struct {
Type string `json:"type"`
Power string `json:"power"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"setting"`
} `json:"nextScheduleChange"`
NextTimeBlock struct {
Start time.Time `json:"start"`
} `json:"nextTimeBlock"`
Link struct {
State string `json:"state"`
} `json:"link"`
ActivityDataPoints struct {
HeatingPower struct {
Type string `json:"type"`
Percentage float64 `json:"percentage"`
Timestamp time.Time `json:"timestamp"`
} `json:"heatingPower"`
} `json:"activityDataPoints"`
SensorDataPoints struct {
InsideTemperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
Timestamp time.Time `json:"timestamp"`
Type string `json:"type"`
Precision struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"precision"`
} `json:"insideTemperature"`
Humidity struct {
Type string `json:"type"`
Percentage float64 `json:"percentage"`
Timestamp time.Time `json:"timestamp"`
} `json:"humidity"`
} `json:"sensorDataPoints"`
}
// GetZoneStateInput is the input for GetZoneState
type GetZoneStateInput struct {
HomeID int
ZoneID int
}
func (gzsi *GetZoneStateInput) method() string {
return http.MethodGet
}
func (gzsi *GetZoneStateInput) path() string {
return fmt.Sprintf("/v2/homes/%d/zones/%d/state", gzsi.HomeID, gzsi.ZoneID)
}
func (gzsi *GetZoneStateInput) body() interface{} {
return nil
}
// GetZoneStateOutput is the output for GetZoneState
type GetZoneStateOutput struct {
ZoneState
}