From 2dbdfd213c77008eea3e7ac4db5e53bd36b0177d Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Thu, 28 May 2026 12:29:52 +0200 Subject: [PATCH] Deactivate bargraph after BLE disconnect --- .gitignore | 1 - esphome/owon-b35t-m5stack-core2.h | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 01c3840..1dea950 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,3 @@ home-assistant.log* zigbee.db* *__pycache__* .ha_run.lock - diff --git a/esphome/owon-b35t-m5stack-core2.h b/esphome/owon-b35t-m5stack-core2.h index 95c7602..647d5e4 100644 --- a/esphome/owon-b35t-m5stack-core2.h +++ b/esphome/owon-b35t-m5stack-core2.h @@ -408,7 +408,8 @@ class Meter { std::string unit_line = std::string(this->scale()) + this->unit(); it.print(270, 140, font, yellow, esphome::display::TextAlign::CENTER, unit_line.c_str()); - this->draw_bargraph_(it, this->has_reading && !this->overload ? this->digits_from_buffer_() : 0, this->has_reading && !this->overload); + bool bargraph_active = this->connected && this->has_reading && !this->overload; + this->draw_bargraph_(it, bargraph_active ? this->digits_from_buffer_() : 0, bargraph_active); this->draw_icon_(it, 300, 148, 16, 16, DIODE_BMP, this->diode() ? magenta : inactive); this->draw_icon_(it, 300, 174, 16, 16, BUZZ_BMP, this->continuity() ? orange : inactive);