Skip to content

Commit

Permalink
was: hide lbl_ln4 when WAS WS is connected
Browse files Browse the repository at this point in the history
The label sometimes showed "Connecting to WAS ..." when it shouldn't.
Clear the label and restore text alignment to left, to avoid the label
showing up when it shouldn't.
  • Loading branch information
stintel committed Nov 17, 2023
1 parent f47e438 commit 14d68eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main/was.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ static void IRAM_ATTR cb_ws_event(const void *arg_evh, const esp_event_base_t *b
if (!config_valid) {
request_config();
}
if (lvgl_port_lock(lvgl_lock_timeout)) {
lv_obj_add_flag(lbl_ln4, LV_OBJ_FLAG_HIDDEN);
lv_obj_set_style_text_align(lbl_ln4, LV_TEXT_ALIGN_LEFT, 0);
lvgl_port_unlock();
}
break;
case WEBSOCKET_EVENT_DATA:
ESP_LOGV(TAG, "WebSocket data received");
Expand Down

0 comments on commit 14d68eb

Please sign in to comment.