mirror of
https://github.com/esphome/esphome.git
synced 2026-03-23 22:37:31 +08:00
[light] Fix binary light spamming 'brightness not supported' warning with strobe effect (#14735)
This commit is contained in:
committed by
Jesse Hills
parent
aacbaab5f8
commit
b0447dc521
@@ -214,7 +214,14 @@ LightColorValues LightCall::validate_() {
|
||||
if (this->has_brightness() && this->brightness_ == 0.0f) {
|
||||
this->state_ = false;
|
||||
this->set_flag_(FLAG_HAS_STATE);
|
||||
this->brightness_ = 1.0f;
|
||||
if (color_mode & ColorCapability::BRIGHTNESS) {
|
||||
// Reset brightness so the light has nonzero brightness when turned back on.
|
||||
this->brightness_ = 1.0f;
|
||||
} else {
|
||||
// Light doesn't support brightness; clear the flag to avoid a spurious
|
||||
// "brightness not supported" warning during capability validation.
|
||||
this->clear_flag_(FLAG_HAS_BRIGHTNESS);
|
||||
}
|
||||
}
|
||||
|
||||
// Set color brightness to 100% if currently zero and a color is set.
|
||||
|
||||
Reference in New Issue
Block a user