From 4225c91fb9ea07bc401fc1ced79c76421ae32557 Mon Sep 17 00:00:00 2001 From: Kristian Kielhofner Date: Mon, 18 Sep 2023 10:37:37 -0500 Subject: [PATCH] Make multiwake use dynamically configurable. Defaults to disabled. --- main/was.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main/was.c b/main/was.c index 4b707d422..fee92de7c 100644 --- a/main/was.c +++ b/main/was.c @@ -302,6 +302,11 @@ void send_wake_start(float wake_volume) char *json; esp_err_t ret; + // Silently return if multiwake is not enabled - defaults to not enabled + if (!config_get_bool("multiwake", false)) { + return; + } + if (!esp_websocket_client_is_connected(hdl_wc)) { ESP_LOGW(TAG, "Websocket not connected - skipping wake start"); return; @@ -334,6 +339,11 @@ void send_wake_end(void) char *json; esp_err_t ret; + // Silently return if multiwake is not enabled - defaults to not enabled + if (!config_get_bool("multiwake", false)) { + return; + } + if (!esp_websocket_client_is_connected(hdl_wc)) { ESP_LOGW(TAG, "Websocket not connected - skipping wake end"); return;