Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
5afff53301 | |||
25eab5d38e |
6 changed files with 6 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required (VERSION 3.7)
|
cmake_minimum_required (VERSION 3.7)
|
||||||
project(controller
|
project(controller
|
||||||
VERSION 0.3.6
|
VERSION 0.3.7
|
||||||
LANGUAGES C)
|
LANGUAGES C)
|
||||||
|
|
||||||
add_executable(controller src/main.c)
|
add_executable(controller src/main.c)
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <uuid/uuid.h>
|
#include <uuid/uuid.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <lmdb.h>
|
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <models/relay.h>
|
#include <models/relay.h>
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <lmdb.h>
|
|
||||||
|
|
||||||
#include <constants.h>
|
#include <constants.h>
|
||||||
#include <models/schedule.h>
|
#include <models/schedule.h>
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <uuid/uuid.h>
|
#include <uuid/uuid.h>
|
||||||
#include <lmdb.h>
|
|
||||||
|
|
||||||
#include <models/period.h>
|
#include <models/period.h>
|
||||||
|
|
||||||
|
|
|
@ -38,17 +38,17 @@ handler_loop(struct mg_connection *c_mqtt)
|
||||||
|
|
||||||
if(is_on_schedule)
|
if(is_on_schedule)
|
||||||
{
|
{
|
||||||
|
if(!pulse_relay)
|
||||||
|
{
|
||||||
|
is_on = 1;
|
||||||
|
LOGGER_DEBUG("relay %d is active\n", i);
|
||||||
|
}
|
||||||
if(pulse_relay && relay->pulse_timer)
|
if(pulse_relay && relay->pulse_timer)
|
||||||
{
|
{
|
||||||
is_on = 1;
|
is_on = 1;
|
||||||
--relay->pulse_timer;
|
--relay->pulse_timer;
|
||||||
LOGGER_DEBUG("relay %d is pulsing for %d more seconds\n", i, relay->pulse_timer);
|
LOGGER_DEBUG("relay %d is pulsing for %d more seconds\n", i, relay->pulse_timer);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
is_on = 1;
|
|
||||||
LOGGER_DEBUG("relay %d is active\n", i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <lmdb.h>
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue