From bdbf7b6c4faa1302752c79d706dac92fcae1aba9 Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Fri, 8 Mar 2024 16:14:05 +0200 Subject: [PATCH] Never provide configurable description or sort order in arguments --- src/sensesp/net/http_server.h | 5 ++--- src/sensesp/system/observablevalue.h | 5 ++--- src/sensesp_base_app.cpp | 6 ++++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sensesp/net/http_server.h b/src/sensesp/net/http_server.h index ae932c6c3..57bec9050 100644 --- a/src/sensesp/net/http_server.h +++ b/src/sensesp/net/http_server.h @@ -56,10 +56,9 @@ class HTTPRequestHandler { class HTTPServer : public Configurable { public: HTTPServer(int port = HTTP_DEFAULT_PORT, - String config_path = "/system/httpserver", String description = "", - int sort_order = 0) + String config_path = "/system/httpserver") : config_(HTTPD_DEFAULT_CONFIG()), - Configurable(config_path, description, sort_order) { + Configurable(config_path) { config_.server_port = port; config_.stack_size = 4096; config_.max_uri_handlers = 20; diff --git a/src/sensesp/system/observablevalue.h b/src/sensesp/system/observablevalue.h index adadc2b56..243568751 100644 --- a/src/sensesp/system/observablevalue.h +++ b/src/sensesp/system/observablevalue.h @@ -51,10 +51,9 @@ class PersistingObservableValue : public ObservableValue, public: PersistingObservableValue() : Configurable() {} - PersistingObservableValue(const T& value, String config_path = "", - String description = "", int sort_order = 0) + PersistingObservableValue(const T& value, String config_path = "") : ObservableValue(value), - Configurable(config_path, description, sort_order) { + Configurable(config_path) { load_configuration(); } diff --git a/src/sensesp_base_app.cpp b/src/sensesp_base_app.cpp index 19fcd6f2f..cae21d9cb 100644 --- a/src/sensesp_base_app.cpp +++ b/src/sensesp_base_app.cpp @@ -22,8 +22,10 @@ SensESPBaseApp::SensESPBaseApp() { filesystem_ = new Filesystem(); // create the hostname_ observable - this needs to be done before // the builder methods are called - hostname_ = new PersistingObservableValue( - kDefaultHostname, "/system/hostname", "Hostname", 0); + hostname_ = new PersistingObservableValue(kDefaultHostname, + "/system/hostname"); + hostname_->set_description("Device hostname"); + hostname_->set_sort_order(0); // create a remote debugger object debug_output_ = new DebugOutput(); }