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

View file

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

View file

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