Removing CI Complaints

This commit is contained in:
DJGummikuh 2024-08-13 17:01:00 +00:00
parent d8fea06244
commit 304b40f46f
3 changed files with 28 additions and 27 deletions

View file

@ -9,14 +9,14 @@ from esphome.const import (
CONF_ID,
CONF_LAMBDA,
CONF_MODEL,
CONF_NUM_SEGMENTS_X,
CONF_NUM_SEGMENTS_Y,
CONF_PAGES,
CONF_RESET_DURATION,
CONF_RESET_PIN,
)
DEPENDENCIES = ["spi"]
CONF_NUM_SEGMENTS_X = "num_segments_x"
CONF_NUM_SEGMENTS_Y = "num_segments_y"
waveshare_epaper_ns = cg.esphome_ns.namespace("waveshare_epaper")
WaveshareEPaperBase = waveshare_epaper_ns.class_(
"WaveshareEPaperBase", cg.PollingComponent, spi.SPIDevice, display.DisplayBuffer

View file

@ -1584,13 +1584,34 @@ void GDEY075Z08::calculate_CRCs_(bool fullSync) {
}
void GDEY075Z08::set_full_update_every(uint32_t full_update_every) { this->full_update_every_ = full_update_every; }
void GDEY075Z08::set_num_segments_x(uint8_t value) {
if (this->get_width_internal() % (value * 8) != 0) {
ESP_LOGD(TAG,
"Invalid number of X Segments (%d) The display width divided by number of segments must be divisible by "
"8 for "
"proper byte boundaries. Setting num_segments_x to 20.",
value); // We actually don't have to do anything, 10 is the default value :o)
} else {
this->seg_x_ = value;
}
}
void GDEY075Z08::set_num_segments_y(uint8_t value) {
if (this->get_height_internal() % value != 0) {
ESP_LOGD(TAG,
"Invalid number of Y Segments (%d). The display height (480px) must be divisible by the number of y "
"segments for equal segment height. Setting num_segments_y to 10.",
value); // We actually don't have to do anything, 10 is the default value :o)
} else {
this->seg_y_ = value;
}
}
void GDEY075Z08::init_fast() {
this->reset_(); // Module reset
this->command(0x00); // PANNEL SETTING
this->data(0x0F); // KW-3f KWR-2F BWROTP 0f BWOTP 1f
this->command(0x04);
delay(100);
delay(100); // NOLINT
this->wait_until_idle_(); // waiting for the electronic paper IC to release the idle signal
// Enhanced display drive(Add 0x06 command)
@ -1772,7 +1793,7 @@ void GDEY075Z08::deep_sleep() {
this->command(0x50);
this->data(0xF7); // check byte
this->command(0x02);
delay(100);
delay(100); // NOLINT
this->command(0x07);
this->data(0xA5);
ESP_LOGI(TAG, "Display now in deep sleep.");

View file

@ -237,28 +237,8 @@ class GDEY075Z08 : public WaveshareEPaperBWR {
void dump_config() override;
void deep_sleep() override;
void set_full_update_every(uint32_t full_update_every);
void set_num_segments_x(uint8_t value) {
if (this->get_width_internal() % (value * 8) != 0) {
ESP_LOGD(TAG,
"Invalid number of X Segments (%d) The display width divided by number of segments must be divisible by "
"8 for "
"proper byte boundaries. Setting num_segments_x to 20.",
value);
} else {
this->seg_x_ = value;
}
}
void set_num_segments_y(uint8_t value) {
if (this->get_height_internal() % value != 0) {
ESP_LOGD(TAG,
"Invalid number of Y Segments (%d). The display height (480px) must be divisible by the number of y "
"segments for equal segment height. Setting num_segments_y to 10.",
value);
uint8_t replacementvalue = this->get_height_internal() /
} else {
this->seg_y_ = value;
}
}
void set_num_segments_x(uint8_t value);
void set_num_segments_y(uint8_t value);
protected:
bool wait_until_idle_();