diff --git a/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.cpp b/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.cpp index 34120c908b6..bce4adfc09c 100644 --- a/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.cpp +++ b/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.cpp @@ -21,18 +21,9 @@ static uint8_t plane_byte(uint8_t first, uint8_t second, bool high_bit) { return out; } -void EPaperSSD1677Gray4::fill(Color color) { - if (this->get_clipping().is_set()) { - // Falls back to the generic per-pixel implementation for the clipped rectangle. - EPaperBase::fill(color); - return; - } +void EPaperSSD1677Gray4::fill_buffer(Color color) { const uint8_t level = color_to_gray4(color); this->buffer_.fill((uint8_t) (level | (level << 2) | (level << 4) | (level << 6))); - this->x_low_ = 0; - this->y_low_ = 0; - this->x_high_ = this->width_; - this->y_high_ = this->height_; } void HOT EPaperSSD1677Gray4::draw_pixel_at(int x, int y, Color color) { diff --git a/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.h b/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.h index 47436d2db1d..ea31210be8d 100644 --- a/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.h +++ b/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.h @@ -34,10 +34,10 @@ class EPaperSSD1677Gray4 : public EPaperSSD1677 { this->buffer_length_ = (size_t) this->row_width_ * height; } - void fill(Color color) override; void draw_pixel_at(int x, int y, Color color) override; protected: + void fill_buffer(Color color) override; // A partial update if partial updates are enabled and this is not a full one. bool is_partial_push_() const { return this->update_count_ != 0 && this->sent_.is_valid(); } bool buffer_is_plane() const override { return false; }