From f0e557b5e4fc74acb155315859ecbd58786296b7 Mon Sep 17 00:00:00 2001 From: deejaybeam Date: Sat, 1 Apr 2023 02:11:00 +0200 Subject: [PATCH] fix: avoid "0" brightness in some cases --- nspanel_esphome.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 30f3460..9e1a296 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -331,12 +331,12 @@ api: id(disp1).set_component_font_color(btnbri.c_str(), btn_bri_font); id(disp1).set_component_text_printf(btnicon.c_str(), "%s", btn_icon.c_str()); id(disp1).set_component_text_printf(btntext.c_str(), "%s", btn_label.c_str()); - id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str()); - // if (strcmp(btn_bri_txt.c_str(), "0") != 0) { - // id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str()); - // } else { - // id(disp1).set_component_text_printf(btnbri.c_str(), "%s", std::string(" ")); - // } + // id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str()); + if (strcmp(btn_bri_txt.c_str(), "0") != 0) { + id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str()); + } else { + id(disp1).set_component_text_printf(btnbri.c_str(), " "); + } ##### START - GLOBALS CONFIGURATION ##### globals: