[light] Fix binary light spamming 'brightness not supported' warning with strobe effect (#14735)

This commit is contained in:
J. Nick Koston
2026-03-12 14:49:07 -10:00
committed by Jesse Hills
parent aacbaab5f8
commit b0447dc521

View File

@@ -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.