mirror of
https://github.com/esphome/esphome.git
synced 2025-03-15 15:18:16 +00:00
fix: initialize validation_bytes in DynamicLampTimer for proper timer validation
This commit is contained in:
parent
2e4fd39896
commit
1c1650dc24
@ -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);
|
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.active = timer_active;
|
||||||
new_timer.action = action;
|
new_timer.action = action;
|
||||||
new_timer.hour = hour;
|
new_timer.hour = hour;
|
||||||
|
@ -69,7 +69,7 @@ struct CombinedLamp {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct DynamicLampTimer {
|
struct DynamicLampTimer {
|
||||||
unsigned char validation_bytes[4] = {'V', 'D', 'L', 'T'};
|
unsigned char validation_bytes[4];
|
||||||
unsigned char timer_desc[36];
|
unsigned char timer_desc[36];
|
||||||
unsigned char lamp_list[2];
|
unsigned char lamp_list[2];
|
||||||
bool in_use : 1;
|
bool in_use : 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user