Skip to content

Commit e5d93de

Browse files
committed
moved light examples into documents
1 parent 4d1729a commit e5d93de

2 files changed

Lines changed: 247 additions & 256 deletions

File tree

Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
openapi: "3.0.0"
2+
info:
3+
version: 1.0.0
4+
title: FarmCo Lights
5+
license:
6+
name: MIT
7+
servers:
8+
- url: http://farmco.example.com/agroapi/v1
9+
paths:
10+
/light_sensors:
11+
get:
12+
description: Returns all sensors from the system that the user has access to
13+
responses:
14+
'200':
15+
description: A list of sensors.
16+
content:
17+
application/json:
18+
schema:
19+
type: array
20+
items:
21+
$ref: '#/components/schemas/Sensor'
22+
/light_sensors/{sensorId}:
23+
get:
24+
summary: Info for a specific sensor
25+
operationId: showSensorById
26+
tags:
27+
- sensors
28+
parameters:
29+
- name: sensorId
30+
in: path
31+
required: true
32+
description: The id of the sensor to retrieve
33+
schema:
34+
type: string
35+
responses:
36+
'200':
37+
description: Expected response to a valid request
38+
content:
39+
application/json:
40+
schema:
41+
type: array
42+
items:
43+
$ref: "#/components/schemas/Sensors"
44+
default:
45+
description: unexpected error
46+
content:
47+
application/json:
48+
schema:
49+
$ref: "#/components/schemas/Error"
50+
51+
/light_sensors/{sensorId}/measurements:
52+
get:
53+
description: Returns spectrum measurements from a specific sensor
54+
parameters:
55+
- name: type
56+
in: query
57+
required: false
58+
description: ppf or ppfd, defaults to ppfd
59+
schema:
60+
type: string
61+
responses:
62+
'200':
63+
description: A list of measurements
64+
content:
65+
application/json:
66+
schema:
67+
type: array
68+
items:
69+
$ref: '#/components/schemas/SpectrumMeasurement'
70+
71+
/zone/{zoneId}/sensors:
72+
get:
73+
description: Returns all sensors from a zone
74+
responses:
75+
'200':
76+
description: A list of sensors.
77+
content:
78+
application/json:
79+
schema:
80+
type: array
81+
items:
82+
$ref: '#/components/schemas/Sensor'
83+
84+
/light_sensors:
85+
get:
86+
description: Returns all sensors from a zone
87+
responses:
88+
'200':
89+
description: A list of sensors.
90+
content:
91+
application/json:
92+
schema:
93+
type: array
94+
items:
95+
$ref: '#/components/schemas/Sensor'
96+
97+
/light_fixtures:
98+
get:
99+
description: Returns all fixtures that a user has access to
100+
responses:
101+
'200':
102+
description: A list of fixtures.
103+
content:
104+
application/json:
105+
schema:
106+
type: array
107+
items:
108+
$ref: '#/components/schemas/Fixture'
109+
110+
/light_fixtures/{fixtureId}:
111+
get:
112+
summary: Info for a specific fixture
113+
operationId: showFixtureById
114+
tags:
115+
- fixtures
116+
parameters:
117+
- name: fixtureId
118+
in: path
119+
required: true
120+
description: The id of the fixture to retrieve
121+
schema:
122+
type: string
123+
responses:
124+
'200':
125+
description: Expected response to a valid request
126+
content:
127+
application/json:
128+
schema:
129+
type: array
130+
items:
131+
$ref: "#/components/schemas/Fixture"
132+
133+
/light_fixtures/{fixtureId}/light_channels:
134+
get:
135+
description: Returns all channels from a fixture
136+
responses:
137+
'200':
138+
description: A list of channels.
139+
content:
140+
application/json:
141+
schema:
142+
type: array
143+
items:
144+
$ref: '#/components/schemas/Channel'
145+
146+
components:
147+
schemas:
148+
Sensor:
149+
type: object
150+
required:
151+
- id
152+
properties:
153+
name:
154+
type: string
155+
info:
156+
type: string
157+
version:
158+
type: string
159+
location:
160+
***TODO: LOCATION FORMAT*** general.md#location-data
161+
info:
162+
***TODO: INFO FORMAT*** general.md#info-data
163+
age:
164+
type: integer
165+
format: int32
166+
minimum: 0
167+
Sensors:
168+
type: array
169+
items:
170+
$ref: "#components/schemas/Sensor"
171+
Measurement:
172+
type: object
173+
required:
174+
- id
175+
properties:
176+
id:
177+
description: Unique id of the device
178+
type: string
179+
timestamp:
180+
description: UTC timestamp of the measurement
181+
type: string
182+
red:
183+
description: Level of red spectrum light
184+
type: string
185+
blue:
186+
description: Level of blue spectrum light
187+
type: string
188+
green:
189+
description: Level of green spectrum light
190+
type: string
191+
uv:
192+
description: Level of ultraviolet light
193+
type: string
194+
infrared:
195+
description: Level of infrared light
196+
type: string
197+
par:
198+
description: Level of absorbable light
199+
type: string
200+
light:
201+
description: Level of all spectrums of light
202+
type: string
203+
Measurements:
204+
type: array
205+
items:
206+
$ref: "#components/schemas/Measurement"
207+
Fixture:
208+
type: object
209+
required:
210+
- id
211+
- status
212+
properties:
213+
id:
214+
description: Unique id of the fixture
215+
type: string
216+
name:
217+
type: string
218+
status:
219+
description: The active state of the light ('on' or 'off')
220+
type: string
221+
Fixtures:
222+
type: array
223+
items:
224+
$ref: "#components/schemas/Fixture"
225+
Channel:
226+
type: object
227+
required:
228+
- id
229+
properties:
230+
id:
231+
description: Unique id of the channel
232+
lo-color:
233+
description: Lower boundary of the frequency range for a color channel
234+
format: ***TODO FORMAT nm***
235+
hi-color:
236+
description: Upper boundary of the frequency range for a color channel
237+
format: ***TODO FORMAT nm***
238+
cct:
239+
description: Color temperature for a white channel
240+
format: ***TODO FORMAT K (Kelvin)***
241+
intensity:
242+
description: Light intensity
243+
format: ***TODO FORMAT %***
244+
Channels:
245+
type: array
246+
items:
247+
$ref: "#components/schemas/Channel"

0 commit comments

Comments
 (0)