diff --git a/src/web/WebEntityService.cpp b/src/web/WebEntityService.cpp index e89d1b032..e377a8ace 100644 --- a/src/web/WebEntityService.cpp +++ b/src/web/WebEntityService.cpp @@ -36,7 +36,7 @@ void WebEntityService::begin() { // this creates the entity file, saving it to the FS // and also calls when the Entity web page is refreshed void WebEntity::read(WebEntity & webEntity, JsonObject & root) { - JsonArray entity = root.createNestedArray("entity"); + JsonArray entity = root.createNestedArray("entities"); uint8_t counter = 0; for (const EntityItem & entityItem : webEntity.entityItems) { JsonObject ei = entity.createNestedObject(); @@ -61,8 +61,8 @@ StateUpdateResult WebEntity::update(JsonObject & root, WebEntity & webEntity) { } webEntity.entityItems.clear(); - if (root["entity"].is()) { - for (const JsonObject ei : root["entity"].as()) { + if (root["entities"].is()) { + for (const JsonObject ei : root["entities"].as()) { auto entityItem = EntityItem(); entityItem.device_id = ei["device_id"]; // send as numeric, will be converted to string in web entityItem.type_id = ei["type_id"]; diff --git a/src/web/WebEntityService.h b/src/web/WebEntityService.h index 41de3ed9c..37a94e15f 100644 --- a/src/web/WebEntityService.h +++ b/src/web/WebEntityService.h @@ -21,7 +21,7 @@ #define WebEntityService_h #define EMSESP_ENTITY_FILE "/config/emsespEntity.json" -#define EMSESP_ENTITY_SERVICE_PATH "/rest/entity" // GET and POST +#define EMSESP_ENTITY_SERVICE_PATH "/rest/entities" // GET and POST namespace emsesp {