API doc changes

This commit is contained in:
Djuri Baars 2024-06-08 11:24:30 +02:00
parent e859adac86
commit 4f15eee72b
3 changed files with 9 additions and 8 deletions

View file

@ -18,7 +18,6 @@
export let settings = {}; export let settings = {};
export let customText: string; export let customText: string;
export let ledColor: string = '#FFCC00';
export let status: Writable<{ leds: [] }>; export let status: Writable<{ leds: [] }>;
let ledStatus = []; let ledStatus = [];
let keepLedsSameColor = false; let keepLedsSameColor = false;
@ -41,8 +40,7 @@
}; };
const setLEDcolor = () => { const setLEDcolor = () => {
console.log(`${PUBLIC_BASE_URL}/api/lights/${ledColor}`); fetch(`${PUBLIC_BASE_URL}/api/lights/set`, {
fetch(`${PUBLIC_BASE_URL}/api/lights`, {
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },

View file

@ -43,7 +43,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": null "$ref": "#/components/schemas/ArrayOfLeds"
} }
} }
} }
@ -202,7 +202,9 @@
} }
} }
} }
}
}, },
"/lights/set": {
"patch": { "patch": {
"tags": ["lights"], "tags": ["lights"],
"summary": "Set individual LEDs", "summary": "Set individual LEDs",
@ -225,7 +227,7 @@
} }
} }
}, },
"/lights/{color}": { "/lights/color/{color}": {
"get": { "get": {
"tags": ["lights"], "tags": ["lights"],
"summary": "Turn on LEDs with specific color", "summary": "Turn on LEDs with specific color",

View file

@ -33,7 +33,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: #/components/schemas/ArrayOfLeds $ref: '#/components/schemas/ArrayOfLeds'
post: post:
tags: tags:
- system - system
@ -139,6 +139,7 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ArrayOfLeds' $ref: '#/components/schemas/ArrayOfLeds'
/lights/set:
patch: patch:
tags: tags:
- lights - lights
@ -153,7 +154,7 @@ paths:
description: succesful operation description: succesful operation
'400': '400':
description: invalid colors or wrong amount of LEDs description: invalid colors or wrong amount of LEDs
/lights/{color}: /lights/color/{color}:
get: get:
tags: tags:
- lights - lights