-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels_device.go
47 lines (40 loc) · 1.13 KB
/
models_device.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
package tado
import (
"fmt"
"net/http"
"time"
)
type Device 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"`
InPairingMode bool `json:"inPairingMode,omitempty"`
MountingState struct {
Value string `json:"value"`
Timestamp time.Time `json:"timestamp"`
} `json:"mountingState,omitempty"`
BatteryState string `json:"batteryState,omitempty"`
}
// GetDevicesInput is the input for GetDevices
type GetDevicesInput struct {
HomeID int
}
func (gdi *GetDevicesInput) method() string {
return http.MethodGet
}
func (gdi *GetDevicesInput) path() string {
return fmt.Sprintf("/v2/homes/%d/devices", gdi.HomeID)
}
func (gdi *GetDevicesInput) body() interface{} {
return nil
}
// GetDevicesOutput is the output for GetDevices
type GetDevicesOutput []Device