Skip to content

Commit

Permalink
Skip sending multiwake start/end when WAS websocket is disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
kristiankielhofner committed Sep 15, 2023
1 parent e5fb580 commit 1a953eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main/was.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ void send_wake_start(float wake_volume)
esp_err_t ret;

if (!esp_websocket_client_is_connected(hdl_wc)) {
esp_websocket_client_destroy(hdl_wc);
init_was();
ESP_LOGI(TAG, "Websocket not connected - skipping wake start");
return;
}

cJSON *cjson = cJSON_CreateObject();
Expand Down Expand Up @@ -335,8 +335,8 @@ void send_wake_end(void)
esp_err_t ret;

if (!esp_websocket_client_is_connected(hdl_wc)) {
esp_websocket_client_destroy(hdl_wc);
init_was();
ESP_LOGI(TAG, "Websocket not connected - skipping wake end");
return;
}

cJSON *cjson = cJSON_CreateObject();
Expand Down

0 comments on commit 1a953eb

Please sign in to comment.