fix: timezone issue
This commit is contained in:
parent
ad7a6028b3
commit
27cec1d8cc
10 changed files with 27 additions and 28 deletions
handlers
|
@ -15,12 +15,14 @@
|
|||
void
|
||||
handler_loop(controller_t *controller)
|
||||
{
|
||||
time_t timestamp = time(NULL);
|
||||
struct tm *time_struct = localtime(×tamp);
|
||||
LOG_DEBUG("===== IDLE LOOP START =====\n");
|
||||
for(uint_fast8_t i = 0; i < controller->relay_count; ++i)
|
||||
{
|
||||
relay_t *relay = controller->relays[i];
|
||||
int is_active = 0;
|
||||
if(relay_is_active(relay, time(NULL)))
|
||||
if(relay_is_active(relay, time_struct))
|
||||
{
|
||||
LOG_DEBUG("relay %d is active\n", i);
|
||||
is_active = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue