mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 11:22:24 +01:00
[ssd1351] fix: wait for the component to be at least in setup phase b… (#5454)
This commit is contained in:
@@ -112,6 +112,9 @@ void SSD1351::set_brightness(float brightness) {
|
|||||||
} else {
|
} else {
|
||||||
this->brightness_ = brightness;
|
this->brightness_ = brightness;
|
||||||
}
|
}
|
||||||
|
if (!this->is_ready()) {
|
||||||
|
return; // Component is not yet setup skip the command
|
||||||
|
}
|
||||||
// now write the new brightness level to the display
|
// now write the new brightness level to the display
|
||||||
this->command(SSD1351_CONTRASTMASTER);
|
this->command(SSD1351_CONTRASTMASTER);
|
||||||
this->data(int(SSD1351_MAX_CONTRAST * (this->brightness_)));
|
this->data(int(SSD1351_MAX_CONTRAST * (this->brightness_)));
|
||||||
|
Reference in New Issue
Block a user