From 514d11d46ffc049927b076d285d8034e5d986266 Mon Sep 17 00:00:00 2001
From: Anthony Uk <1492471+dataway@users.noreply.github.com>
Date: Sat, 22 May 2021 01:04:25 +0200
Subject: [PATCH] tm1637 - support 6 character displays (#1803)

---
 esphome/components/tm1637/tm1637.cpp | 2 +-
 esphome/components/tm1637/tm1637.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/esphome/components/tm1637/tm1637.cpp b/esphome/components/tm1637/tm1637.cpp
index 833e3caecd..b58cec4748 100644
--- a/esphome/components/tm1637/tm1637.cpp
+++ b/esphome/components/tm1637/tm1637.cpp
@@ -253,7 +253,7 @@ uint8_t TM1637Display::print(uint8_t start_pos, const char* str) {
         pos--;
       this->buffer_[pos] |= 0b10000000;
     } else {
-      if (pos >= 4) {
+      if (pos >= 6) {
         ESP_LOGE(TAG, "String is too long for the display!");
         break;
       }
diff --git a/esphome/components/tm1637/tm1637.h b/esphome/components/tm1637/tm1637.h
index 91e8ba66c0..003344eae9 100644
--- a/esphome/components/tm1637/tm1637.h
+++ b/esphome/components/tm1637/tm1637.h
@@ -63,7 +63,7 @@ class TM1637Display : public PollingComponent {
   GPIOPin *clk_pin_;
   uint8_t intensity_;
   optional<tm1637_writer_t> writer_{};
-  uint8_t buffer_[4] = {0};
+  uint8_t buffer_[6] = {0};
 };
 
 }  // namespace tm1637