-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.go
153 lines (143 loc) · 4.25 KB
/
structs.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
package main
type Success struct {
Success bool `json:"success"`
}
// STATE
type DeviceState struct {
Audio Audio `json:"audio"`
Bluetooth Bluetooth `json:"bluetooth"`
Display Display `json:"display"`
ID string `json:"id"`
Mode string `json:"mode"`
Model string `json:"model"`
Name string `json:"name"`
OsVersion string `json:"os_version"`
SerialNumber string `json:"serial_number"`
Wifi Wifi `json:"wifi"`
}
type VolumeLimit struct {
Max int `json:"max"`
Min int `json:"min"`
}
type VolumeRange struct {
Max int `json:"max"`
Min int `json:"min"`
}
type Audio struct {
Volume int `json:"volume"`
VolumeLimit VolumeLimit `json:"volume_limit"`
VolumeRange VolumeRange `json:"volume_range"`
}
type LowEnergy struct {
Active bool `json:"active"`
Advertising bool `json:"advertising"`
Connectable bool `json:"connectable"`
}
type Bluetooth struct {
Active bool `json:"active"`
Address string `json:"address"`
Available bool `json:"available"`
Discoverable bool `json:"discoverable"`
LowEnergy LowEnergy `json:"low_energy"`
Name string `json:"name"`
Pairable bool `json:"pairable"`
}
type BrightnessLimit struct {
Max int `json:"max"`
Min int `json:"min"`
}
type BrightnessRange struct {
Max int `json:"max"`
Min int `json:"min"`
}
type TimeBased struct {
Enabled bool `json:"enabled"`
EndTime string `json:"end_time"`
LocalEndTime string `json:"local_end_time"`
LocalStartTime string `json:"local_start_time"`
StartTime string `json:"start_time"`
}
type WhenDark struct {
Enabled bool `json:"enabled"`
}
type Modes struct {
TimeBased TimeBased `json:"time_based"`
WhenDark WhenDark `json:"when_dark"`
}
type Screensaver struct {
Enabled bool `json:"enabled"`
Modes Modes `json:"modes"`
Widget string `json:"widget"`
}
type Display struct {
Brightness int `json:"brightness"`
BrightnessLimit BrightnessLimit `json:"brightness_limit"`
BrightnessMode string `json:"brightness_mode"`
BrightnessRange BrightnessRange `json:"brightness_range"`
Height int `json:"height"`
Screensaver Screensaver `json:"screensaver"`
Type string `json:"type"`
Width int `json:"width"`
}
type Wifi struct {
Active bool `json:"active"`
Address string `json:"address"`
Available bool `json:"available"`
Encryption string `json:"encryption"`
Essid string `json:"essid"`
IP string `json:"ip"`
Mode string `json:"mode"`
Netmask string `json:"netmask"`
Strength int `json:"strength"`
}
// NOTIFICATIONS
// https://lametric-documentation.readthedocs.io/en/latest/reference-docs/device-notifications.html
type Notification struct {
Priority string `json:"priority"`
IconType string `json:"icon_type"`
LifeTime int `json:"lifeTime"`
Model Model `json:"model"`
Created string `json:"created"`
ID string `json:"id"`
ExpirationDate string `json:"expiration_date"`
}
type GoalData struct {
Start int `json:"start"`
Current int `json:"current"`
End int `json:"end"`
Unit string `json:"unit"`
}
type Frames struct {
Icon string `json:"icon,omitempty"`
Text string `json:"text,omitempty"`
GoalData GoalData `json:"goalData,omitempty"`
ChartData []int `json:"chartData,omitempty"`
}
type Sound struct {
Category string `json:"category"`
ID string `json:"id"`
Repeat int `json:"repeat"`
}
type Model struct {
Frames []Frames `json:"frames"`
Sound Sound `json:"sound"`
Cycles int `json:"cycles"`
}
// APPS
type Widget struct {
Index int `json:"index"`
Package string `json:"package"`
}
type Trigger interface{}
type Action interface{}
type App struct {
Actions map[string]Action `json:"actions"`
Package string `json:"package"`
Title string `json:"title"`
Triggers []Trigger `json:"triggers"`
Vendor string `json:"vendor"`
Version string `json:"version"`
VersionCode string `json:"versionCode"`
Widgets map[string]Widget `json:"widgets"`
}
type Apps map[string]App