From bed26fd121bb2daef3816faf5395f49a04a7a98c Mon Sep 17 00:00:00 2001 From: Andre Thomas Date: Mon, 30 Sep 2019 17:19:15 +0200 Subject: [PATCH 1/2] MCP230xx - Add 1 and 0 as option for ON and OFF MCP230xx - Add 1 and 0 as option for ON and OFF --- sonoff/xsns_29_mcp230xx.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonoff/xsns_29_mcp230xx.ino b/sonoff/xsns_29_mcp230xx.ino index caefb67e8..9eb98b95a 100644 --- a/sonoff/xsns_29_mcp230xx.ino +++ b/sonoff/xsns_29_mcp230xx.ino @@ -628,11 +628,11 @@ bool MCP230xx_Command(void) { #ifdef USE_MCP230xx_OUTPUT if (Settings.mcp230xx_config[pin].pinmode >= 5) { uint8_t pincmd = Settings.mcp230xx_config[pin].pinmode - 5; - if (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "ON")) { + if ((!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "ON")) || (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "1"))) { MCP230xx_SetOutPin(pin,abs(pincmd-1)); return serviced; } - if (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "OFF")) { + if ((!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "OFF")) || (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "0"))) { MCP230xx_SetOutPin(pin,pincmd); return serviced; } From b38a8bd8eb8ac1f5457764a656bbc0533457fcf9 Mon Sep 17 00:00:00 2001 From: Andre Thomas Date: Mon, 30 Sep 2019 17:26:07 +0200 Subject: [PATCH 2/2] MCP230xx - Add sensor29 pin,1 and sensor29 pin,0 MCP230xx - Add sensor29 pin,1 and sensor29 pin,0 as an alternative to sensor29 pin,ON and sensor29 pin,OFF respectively. --- sonoff/_changelog.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 5b26d35d3..8429ce360 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -5,6 +5,7 @@ * Add initial support for MQTT logging using command MqttLog (#6498) * Add Zigbee more support - collect endpoints and clusters, added ZigbeeDump command * Add initial support for shutters by Stefan Bode (#288) + * Add use case for sensor29 pin,1 and sensor29 pin,0 to substitute ON and OFF respectively with MCP230xx driver * * 6.6.0.13 20190922 * Add command EnergyReset4 x,x to initialize total usage for two tarrifs