1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-14 06:38:17 +00:00

fix: initialize validation_bytes in DynamicLampTimer for proper timer validation

This commit is contained in:
Oliver Kleinecke 2025-02-19 17:24:42 +01:00
parent 2e4fd39896
commit 1c1650dc24
2 changed files with 6 additions and 1 deletions

View File

@ -257,6 +257,11 @@ bool DynamicLampComponent::add_timer(std::string timer_desc, std::string lamp_li
}
}
memcpy(new_timer.lamp_list, lamp_list_bytes, 2);
new_timer.in_use = true;
new_timer.validation_bytes[0] = 'V';
new_timer.validation_bytes[1] = 'D';
new_timer.validation_bytes[2] = 'L';
new_timer.validation_bytes[3] = 'T';
new_timer.active = timer_active;
new_timer.action = action;
new_timer.hour = hour;

View File

@ -69,7 +69,7 @@ struct CombinedLamp {
};
struct DynamicLampTimer {
unsigned char validation_bytes[4] = {'V', 'D', 'L', 'T'};
unsigned char validation_bytes[4];
unsigned char timer_desc[36];
unsigned char lamp_list[2];
bool in_use : 1;