From a19d789174394739eb360f729f2963b81e1cc946 Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Tue, 9 Jul 2024 20:04:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=84=20Formats=20FeatureService?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esp32/lib/ESP32-sveltekit/FeaturesService.cpp | 3 +-- esp32/lib/ESP32-sveltekit/FeaturesService.h | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/esp32/lib/ESP32-sveltekit/FeaturesService.cpp b/esp32/lib/ESP32-sveltekit/FeaturesService.cpp index c0563d9..0833a8c 100644 --- a/esp32/lib/ESP32-sveltekit/FeaturesService.cpp +++ b/esp32/lib/ESP32-sveltekit/FeaturesService.cpp @@ -45,8 +45,7 @@ void FeaturesService::begin() { return response.send(); }); - ESP_LOGV("FeaturesService", "Registered GET endpoint: %s", - FEATURES_SERVICE_PATH); + ESP_LOGV("FeaturesService", "Registered GET endpoint: %s", FEATURES_SERVICE_PATH); } void FeaturesService::addFeature(String feature, bool enabled) { diff --git a/esp32/lib/ESP32-sveltekit/FeaturesService.h b/esp32/lib/ESP32-sveltekit/FeaturesService.h index d40d3e3..824bf50 100644 --- a/esp32/lib/ESP32-sveltekit/FeaturesService.h +++ b/esp32/lib/ESP32-sveltekit/FeaturesService.h @@ -24,22 +24,20 @@ #define FEATURES_SERVICE_PATH "/api/features" -typedef struct -{ +typedef struct { String feature; bool enabled; } UserFeature; -class FeaturesService -{ -public: +class FeaturesService { + public: FeaturesService(PsychicHttpServer *server); void begin(); void addFeature(String feature, bool enabled); -private: + private: PsychicHttpServer *_server; std::vector userFeatures; };