From 96be3f47aeac0b8862190662df04dfcb3657b8e4 Mon Sep 17 00:00:00 2001 From: Richard Genoud Date: Fri, 3 Jan 2020 11:26:29 +0100 Subject: [PATCH] soft: pilot_wire: accept 1/0 on/off true/false (case insensitive) --- .../kitchen/kitchen_pilot_wire_control/kitchen_pilot_wire_control.ino | 4 ++-- soft/main_pilot_wire_control/main_pilot_wire_control.ino | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/soft/kitchen/kitchen_pilot_wire_control/kitchen_pilot_wire_control.ino b/soft/kitchen/kitchen_pilot_wire_control/kitchen_pilot_wire_control.ino index fb46193..d0e88f0 100644 --- a/soft/kitchen/kitchen_pilot_wire_control/kitchen_pilot_wire_control.ino +++ b/soft/kitchen/kitchen_pilot_wire_control/kitchen_pilot_wire_control.ino @@ -64,10 +64,10 @@ void lwdtFeed(void) { void message_callback(const String &message) { Serial.println(message); - if (message == "off") { + if (message.equals("0") || message.equalsIgnoreCase("off") || message.equalsIgnoreCase("false")) { heater_off(heating_pin); } - if (message == "on") { + if (message.equals("1") || message.equalsIgnoreCase("on") || message.equalsIgnoreCase("true")) { heater_on(heating_pin); } reset_timer(&keep_alive_timer); diff --git a/soft/main_pilot_wire_control/main_pilot_wire_control.ino b/soft/main_pilot_wire_control/main_pilot_wire_control.ino index abd4caa..53199dd 100644 --- a/soft/main_pilot_wire_control/main_pilot_wire_control.ino +++ b/soft/main_pilot_wire_control/main_pilot_wire_control.ino @@ -81,10 +81,10 @@ void lwdtFeed(void) { void handle_message(enum rooms room, const String &message) { Serial.println(message); - if (message == "off") { + if (message.equals("0") || message.equalsIgnoreCase("off") || message.equalsIgnoreCase("false")) { heater_off(heaters[room].pin); } - if (message == "on") { + if (message.equals("1") || message.equalsIgnoreCase("on") || message.equalsIgnoreCase("true")) { heater_on(heaters[room].pin); } reset_timer(room);