From 25eab5d38ec867cb3834cd31acb6f75029a9cb5e Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Thu, 27 Aug 2020 13:22:10 +0200 Subject: [PATCH] fix: see last commit (I need tests) --- CMakeLists.txt | 2 +- src/handlers/loop.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d07b24..3223e1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project(controller - VERSION 0.3.6 + VERSION 0.3.7 LANGUAGES C) add_executable(controller src/main.c) diff --git a/src/handlers/loop.c b/src/handlers/loop.c index f121bcd..2076952 100644 --- a/src/handlers/loop.c +++ b/src/handlers/loop.c @@ -38,17 +38,17 @@ handler_loop(struct mg_connection *c_mqtt) if(is_on_schedule) { + if(!pulse_relay) + { + is_on = 1; + LOGGER_DEBUG("relay %d is active\n", i); + } if(pulse_relay && relay->pulse_timer) { is_on = 1; --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 {