|
@@ -357,24 +357,23 @@ static esp_err_t httpd_set_config(httpd_req_t *req, const char *query)
|
|
|
return httpd_update_done(req, "Configuration", rv1 ? rv1 : rv2);
|
|
|
}
|
|
|
|
|
|
-#define MIN_STATUS_REF 2 /* Minimum refresh time in ms */
|
|
|
+#define MIN_STATUS_REF 1 /* Minimum refresh time in s */
|
|
|
|
|
|
static void httpd_get_status_extra(FILE *f, httpd_req_t *req)
|
|
|
{
|
|
|
static const char refresh_time_config[] = "http.status.refresh";
|
|
|
- const unsigned long min_status_ref = 5;
|
|
|
char timebuf[64];
|
|
|
size_t len;
|
|
|
struct timeval tv;
|
|
|
|
|
|
unsigned long statref;
|
|
|
- statref = Max(getenv_ul(refresh_time_config, 0), min_status_ref);
|
|
|
+ statref = Max(getenv_ul(refresh_time_config, 0), MIN_STATUS_REF);
|
|
|
|
|
|
if (httpd_req_get_url_query_str(req, timebuf, sizeof timebuf) == ESP_OK &&
|
|
|
*timebuf) {
|
|
|
char *ep;
|
|
|
unsigned long newstatref = strtoul(timebuf, &ep, 10);
|
|
|
- if (!*ep && newstatref >= min_status_ref && newstatref != statref) {
|
|
|
+ if (!*ep && newstatref >= MIN_STATUS_REF && newstatref != statref) {
|
|
|
statref = newstatref;
|
|
|
setenv_config(refresh_time_config, timebuf);
|
|
|
read_config(NULL, true); /* Save changed config */
|