-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathopenapi.yml
261 lines (261 loc) · 6.82 KB
/
openapi.yml
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
openapi: 3.1.0
info:
title: Winderoo API
version: 1.0.0
servers:
- url: http://winderoo.local/api/
description: local development and deployed devices
tags:
- name: Status
description: Retrieve the current state of Winderoo
- name: Modify
description: Modify the state of Winderoo
paths:
/timer:
post:
tags:
- Modify
summary: Change the timer state of Winderoo
parameters:
- in: query
name: timerEnabled
schema:
type: integer
description: Whether Winderoo should enable alarm-start winding; number represents a boolean where 0 == off and 1 == on.
example: 1
responses:
'204':
description: Successful opeation
'400':
description: Missing required field in request body
content:
text/plain:
schema:
type: string
examples:
- "Missing required field: 'tpd'"
'500':
description: Something went wrong when writing to memory or during deserialization
content:
text/plain:
schema:
type: string
examples:
- Failed to deserialize request body
/update:
post:
tags:
- Modify
summary: Change the state of Winderoo
requestBody:
$ref: '#/components/requestBodies/UpdateBody'
responses:
'204':
description: Successful opeation
'400':
description: Missing required field in request body
content:
text/plain:
schema:
type: string
examples:
- "Missing required field: 'tpd'"
'500':
description: Something went wrong when writing to memory or during deserialization
content:
text/plain:
schema:
type: string
examples:
- Failed to deserialize request body
/status:
get:
tags:
- Status
summary: Get the current status of Winderoo
responses:
'200':
description: Service is alive with current winder state
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/power:
post:
tags:
- Modify
summary: Toggle whether Winderoo is on or off (hard off state)
requestBody:
$ref: '#/components/requestBodies/PowerBody'
responses:
'204':
description: State toggled succesfully
'400':
description: Missing required field in request body
content:
text/plain:
schema:
type: string
examples:
- "Missing required field: 'winderEnabled'"
'500':
description: Something went wrong when writing to memory or during deserialization
content:
text/plain:
schema:
type: string
examples:
- Failed to deserialize request body
/reset:
get:
tags:
- Modify
summary: Resets Winderoo's network settings; re-initializes winderoo with setup access point
responses:
'200':
description: State toggled succesfully
content:
application/json:
schema:
$ref: '#/components/schemas/Resetting'
components:
requestBodies:
UpdateBody:
description: a JSON object containing winderoo information
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Update'
example:
tpd: "330"
hour: "14"
minutes: "50"
timerEnabled: "0"
action: "START"
rotationDirection: "BOTH"
screenSleep: false
PowerBody:
description: a JSON object containing winderoo power information
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Power'
example:
winderEnabled: "1"
schemas:
Power:
type: object
propertries:
winderEnabled:
type: string
description:
Whether Winderoo should enable alarm-start winding; number represents a boolean where 0 == off and 1 == on.
examples:
- 0
- 1
Update:
type: object
propertries:
tpd:
type: string
description: how many turns are required
examples:
- 330
hour:
type: string
description: At what hour winderoo should begin winding at
examples:
- 14
minutes:
type: string
description: At what minute winderoo should begin winding at
examples:
- 50
timerEnabled:
type: string
description:
Whether Winderoo should enable alarm-start winding; number represents a boolean where 0 == off and 1 == on.
examples:
- 0
- 1
action:
type: string
description: Whether Winderoo should start or stop winding
examples:
- START
- STOP
rotationDirection:
type: string
description: The winding direction
examples:
- CW
- CCW
- BOTH
Status:
type: object
properties:
status:
type: string
examples:
- Stopped
rotationsPerDay:
type: string
examples:
- 300
direction:
type: string
examples:
- BOTH
hour:
type: string
examples:
- 12
minutes:
type: string
examples:
- 50
durationInSecondsToCompleteOneRevolution:
type: number
examples:
- 8
startTimeEpoch:
type: number
examples:
- 0
currentTimeEpoch:
type: number
examples:
- 1680555863
estimatedRoutineFinishEpoch:
type: number
examples:
- 0
winderEnabled:
type: string
examples:
- 1
timerEnabled:
type: string
examples:
- 1
db:
type: number
examples:
- -67
screenSleep:
type: boolean
examples:
- false
screenEquipped:
type: boolean
examples:
- false
Resetting:
type: object
properties:
status:
type: string
examples:
- Resetting