Skip to content

Commit

Permalink
Make multiwake use dynamically configurable. Defaults to disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
kristiankielhofner committed Sep 18, 2023
1 parent a31ac0c commit 4225c91
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main/was.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4225c91

Please sign in to comment.