From d98130a4968b1057f5a2c9bcc1fa958562b18eee Mon Sep 17 00:00:00 2001 From: Slavomir Hustaty Date: Thu, 22 Feb 2018 10:32:22 +0100 Subject: [PATCH 1/2] Update Switch.h introducing backward compatible method to interact with external integration of this library (for example MQTT broker) --- wemos/Switch.h | 1 + 1 file changed, 1 insertion(+) diff --git a/wemos/Switch.h b/wemos/Switch.h index c58225b..cff6413 100644 --- a/wemos/Switch.h +++ b/wemos/Switch.h @@ -33,6 +33,7 @@ class Switch { void serverLoop(); void respondToSearch(IPAddress& senderIP, unsigned int senderPort); void sendRelayState(); + void setSwitchStatus(bool status); }; #endif From 6e2b6698e3e2062accc1d6d557939d5273198531 Mon Sep 17 00:00:00 2001 From: Slavomir Hustaty Date: Thu, 22 Feb 2018 10:36:36 +0100 Subject: [PATCH 2/2] Update Switch.cpp implementation of previously introduced method in header --- wemos/Switch.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wemos/Switch.cpp b/wemos/Switch.cpp index 1d721f9..5cf191f 100644 --- a/wemos/Switch.cpp +++ b/wemos/Switch.cpp @@ -196,6 +196,10 @@ String Switch::getAlexaInvokeName() { return device_name; } +void Switch::setSwitchStatus(bool status) { + switchStatus = status; +} + void Switch::sendRelayState() { String body = "\r\n"