From e72df056a3bf2e6b4ee1d98c2061040e93e91116 Mon Sep 17 00:00:00 2001 From: coolneng Date: Tue, 16 Dec 2025 16:14:32 +0100 Subject: [PATCH] Remove connection attempts field from Config --- data/example.json | 3 +-- include/config.h | 3 +-- src/config.cpp | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/data/example.json b/data/example.json index 9ad222c..87c9cde 100644 --- a/data/example.json +++ b/data/example.json @@ -7,6 +7,5 @@ "mqtt_port": 1883, "mqtt_topic": "", "device_id": "", - "sleep_time": 30, - "connection_attempts": 60 + "sleep_time": 30 } diff --git a/include/config.h b/include/config.h index eeb7bee..87c5f06 100644 --- a/include/config.h +++ b/include/config.h @@ -12,8 +12,7 @@ typedef struct { const char *topic; const char *device_id; int mqtt_port; - long sleep_time; - int connection_attempts; + unsigned long sleep_time; } Config; void initialize_config(Config *config, JsonDocument json); diff --git a/src/config.cpp b/src/config.cpp index a1ef442..da52799 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -11,7 +11,6 @@ void initialize_config(Config *config, JsonDocument json) { config->device_id = strdup(json["device_id"]); config->mqtt_port = json["mqtt_port"]; config->sleep_time = minutes_to_milliseconds(json["sleep_time"]); - config->connection_attempts = json["connection_attempts"]; } bool load_config_file(const char *file_path, Config *config) {