From fe6f49cd4fc74aa3e6137734fe51759e9c2531a4 Mon Sep 17 00:00:00 2001 From: Lukas Sausen Date: Sat, 7 May 2022 19:44:53 +0200 Subject: [PATCH] changed LEDStrip example to be compliant to convention (Replacing "ON"/"OFF" with "true"/"false" --- examples/LedStrip/LedStrip.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/LedStrip/LedStrip.ino b/examples/LedStrip/LedStrip.ino index 7cfb0d40..d067fa10 100644 --- a/examples/LedStrip/LedStrip.ino +++ b/examples/LedStrip/LedStrip.ino @@ -10,13 +10,13 @@ bool stripLedHandler(const HomieRange& range, const String& value) { if (range.index < 1 || range.index > NUMBER_OF_LED) return false; // if it's not a valid range - if (value != "on" && value != "off") return false; // if the value is not valid + if (value != "true" && value != "false") return false; // if the value is not valid - bool on = (value == "on"); + bool on = (value == "true"); digitalWrite(LED_PINS[range.index - 1], on ? HIGH : LOW); stripNode.setProperty("led").setRange(range).send(value); // Update the state of the led - Homie.getLogger() << "Led " << range.index << " is " << value << endl; + Homie.getLogger() << "Led " << range.index << " is " << (on ? "on" : "off") << endl; return true; }