From 31b8f4f38994fa8a1294ebd1bd417d6d7dc2e532 Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Wed, 19 Feb 2025 12:32:42 +0100 Subject: [PATCH] fix: correct lamp list index calculation in read_timers_to_log function --- esphome/components/dynamic_lamp/dynamic_lamp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/dynamic_lamp/dynamic_lamp.cpp b/esphome/components/dynamic_lamp/dynamic_lamp.cpp index fd9aff118b..4f5f5b3a70 100644 --- a/esphome/components/dynamic_lamp/dynamic_lamp.cpp +++ b/esphome/components/dynamic_lamp/dynamic_lamp.cpp @@ -308,7 +308,7 @@ void DynamicLampComponent::read_timers_to_log() { DynamicLampTimer timer; this->fram_->read((2048), reinterpret_cast(&timer), 24); for (uint8_t j = 0; j < 16; j++) { - bool lamp_included = static_cast(timer.lamp_list[floor(j / 8)] & (1 << (j % 8))); + bool lamp_included = static_cast(timer.lamp_list[j / 8] & (1 << (j % 8))); if (lamp_included && this->active_lamps_[j].active) { ESP_LOGV(TAG, "Timer found for lamp %s |: active: %d, action: %d, hour: %d, minute: %d, monday: %d, tuesday: %d, wednesday: %d, thursday: %d, friday: %d, saturday: %d, sunday: %d", this->active_lamps_[j].name, timer.active, timer.action, timer.hour, timer.minute, timer.monday, timer.tuesday,