mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 16:37:52 +01:00
[ssd1351] fix: wait for the component to be at least in setup phase b… (#5454)
This commit is contained in:
parent
2c94c3d96f
commit
d3913be7e5
@ -112,6 +112,9 @@ void SSD1351::set_brightness(float brightness) {
|
||||
} else {
|
||||
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
|
||||
this->command(SSD1351_CONTRASTMASTER);
|
||||
this->data(int(SSD1351_MAX_CONTRAST * (this->brightness_)));
|
||||
|
Loading…
Reference in New Issue
Block a user