1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-26 23:22:21 +01:00

fix: use explicit boolean comparisons for active and update flags in dynamic_lamp loop

This commit is contained in:
Oliver Kleinecke
2025-02-16 13:20:58 +01:00
parent 5e8242c045
commit 1f0b4d4c51

View File

@@ -44,10 +44,10 @@ void DynamicLampComponent::begin() {
void DynamicLampComponent::loop() {
uint8_t i = 0;
for (i = 0; i < this->lamp_count_; i++) {
if (this->active_lamps_[i].active && this->active_lamps_[i].update_) {
if (this->active_lamps_[i].active == true && this->active_lamps_[i].update_ == true) {
uint8_t j = 0;
for (j = 0; j < 16; j++) {
if (this->active_lamps_[i].used_outputs[j]) {
if (this->active_lamps_[i].used_outputs[j] == true) {
// Update level
float new_state;
new_state = this->active_lamps_[i].state_;