update web ui
Some checks failed
ESP-IDF Build / build (esp32c6, release-v5.4) (push) Failing after 4m6s
ESP-IDF Build / build (esp32c6, release-v5.5) (push) Failing after 4m19s
ESP-IDF Build / build (esp32s3, release-v5.4) (push) Failing after 3m52s
ESP-IDF Build / build (esp32s3, release-v5.5) (push) Failing after 4m4s
Some checks failed
ESP-IDF Build / build (esp32c6, release-v5.4) (push) Failing after 4m6s
ESP-IDF Build / build (esp32c6, release-v5.5) (push) Failing after 4m19s
ESP-IDF Build / build (esp32s3, release-v5.4) (push) Failing after 3m52s
ESP-IDF Build / build (esp32s3, release-v5.5) (push) Failing after 4m4s
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
20
firmware/components/api-server/src/common.c
Normal file
20
firmware/components/api-server/src/common.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "common.h"
|
||||
#include <cJSON.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
// Gibt ein cJSON-Objekt with dem aktuellen Lichtstatus zurück
|
||||
cJSON *create_light_status_json(void)
|
||||
{
|
||||
cJSON *json = cJSON_CreateObject();
|
||||
// TODO: Echte Werte einfügen, aktuell Dummy-Daten
|
||||
cJSON_AddBoolToObject(json, "on", false);
|
||||
cJSON_AddBoolToObject(json, "thunder", false);
|
||||
cJSON_AddStringToObject(json, "mode", "day");
|
||||
cJSON_AddStringToObject(json, "schema", "schema_03.csv");
|
||||
cJSON *color = cJSON_CreateObject();
|
||||
cJSON_AddNumberToObject(color, "r", 255);
|
||||
cJSON_AddNumberToObject(color, "g", 240);
|
||||
cJSON_AddNumberToObject(color, "b", 220);
|
||||
cJSON_AddItemToObject(json, "color", color);
|
||||
return json;
|
||||
}
|
||||
Reference in New Issue
Block a user