From c55e05e7b21f014dfe02ee3e1e0f1a40452e75ca Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 14 Jan 2024 15:16:50 +0100 Subject: [PATCH] remove redundant rest call to /rest/customization --- src/web/WebCustomEntityService.h | 2 +- src/web/WebCustomizationService.cpp | 11 ++--------- src/web/WebCustomizationService.h | 2 -- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/web/WebCustomEntityService.h b/src/web/WebCustomEntityService.h index 568261ddc..ccb98afd8 100644 --- a/src/web/WebCustomEntityService.h +++ b/src/web/WebCustomEntityService.h @@ -21,7 +21,7 @@ #define WebCustomEntityService_h #define EMSESP_CUSTOMENTITY_FILE "/config/emsespEntity.json" -#define EMSESP_CUSTOMENTITY_SERVICE_PATH "/rest/customentities" // GET and POST +#define EMSESP_CUSTOMENTITY_SERVICE_PATH "/rest/customEntities" // GET and POST namespace emsesp { diff --git a/src/web/WebCustomizationService.cpp b/src/web/WebCustomizationService.cpp index 3d76626e8..61e9f18db 100644 --- a/src/web/WebCustomizationService.cpp +++ b/src/web/WebCustomizationService.cpp @@ -25,14 +25,7 @@ using namespace std::placeholders; // for `_1` etc bool WebCustomization::_start = true; WebCustomizationService::WebCustomizationService(AsyncWebServer * server, FS * fs, SecurityManager * securityManager) - : _httpEndpoint(WebCustomization::read, - WebCustomization::update, - this, - server, - EMSESP_CUSTOMIZATION_SERVICE_PATH, - securityManager, - AuthenticationPredicates::IS_AUTHENTICATED) - , _fsPersistence(WebCustomization::read, WebCustomization::update, this, fs, EMSESP_CUSTOMIZATION_FILE) + : _fsPersistence(WebCustomization::read, WebCustomization::update, this, fs, EMSESP_CUSTOMIZATION_FILE) , _masked_entities_handler(CUSTOMIZATION_ENTITIES_PATH, securityManager->wrapCallback(std::bind(&WebCustomizationService::customization_entities, this, _1, _2), AuthenticationPredicates::IS_AUTHENTICATED)) { @@ -85,7 +78,7 @@ void WebCustomization::read(WebCustomization & customizations, JsonObject root) entityJson["product_id"] = entityCustomization.product_id; entityJson["device_id"] = entityCustomization.device_id; - // entries are in the form [|optional customname] e.g "08heatingactive|heating is on" + // entries are in the form [optional customname] e.g "08heatingactive|heating is on" JsonArray masked_entityJson = entityJson["entity_ids"].to(); for (std::string entity_id : entityCustomization.entity_ids) { masked_entityJson.add(entity_id); diff --git a/src/web/WebCustomizationService.h b/src/web/WebCustomizationService.h index 1b4bc8127..8ec322b71 100644 --- a/src/web/WebCustomizationService.h +++ b/src/web/WebCustomizationService.h @@ -23,7 +23,6 @@ // GET #define DEVICES_SERVICE_PATH "/rest/devices" -#define EMSESP_CUSTOMIZATION_SERVICE_PATH "/rest/customization" #define DEVICE_ENTITIES_PATH "/rest/deviceEntities" // POST @@ -89,7 +88,6 @@ class WebCustomizationService : public StatefulService { private: #endif - HttpEndpoint _httpEndpoint; FSPersistence _fsPersistence; // GET