From 25375bb37c4976ae4fa68eea18e9ed0cfa899118 Mon Sep 17 00:00:00 2001 From: 1technophile <1technophile@users.noreply.github.com> Date: Sun, 15 Dec 2019 09:32:15 +0100 Subject: [PATCH] unnecessary pub functions removing and use OMG method instead of low level ones --- main/ZsensorGPIOInput.ino | 2 -- main/ZsensorGPIOKeyCode.ino | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/main/ZsensorGPIOInput.ino b/main/ZsensorGPIOInput.ino index d24187c..352c96e 100644 --- a/main/ZsensorGPIOInput.ino +++ b/main/ZsensorGPIOInput.ino @@ -72,14 +72,12 @@ void MeasureGPIOInput() if (InputState == HIGH) { trc(F("GPIO HIGH")); - pub(subjectGPIOInputtoMQTT, "HIGH"); GPIOdata.set("gpio", "HIGH"); } if (InputState == LOW) { trc(F("GPIO LOW")); GPIOdata.set("gpio", "LOW"); - pub(subjectGPIOInputtoMQTT, "LOW"); } if (GPIOdata.size() > 0) pub(subjectGPIOInputtoMQTT, GPIOdata); diff --git a/main/ZsensorGPIOKeyCode.ino b/main/ZsensorGPIOKeyCode.ino index 725ca81..2b47423 100644 --- a/main/ZsensorGPIOKeyCode.ino +++ b/main/ZsensorGPIOKeyCode.ino @@ -67,7 +67,7 @@ void MeasureGPIOKeyCode() sprintf(hex, "%02x", InputStateGPIOKeyCode); hex[2] = 0; Serial.printf("GPIOKeyCode %s\n", hex); - client.publish(subjectGPIOKeyCodetoMQTT, hex); + pub(subjectGPIOKeyCodetoMQTT, hex); lastLatchStateGPIOKeyCode = latch; } @@ -76,7 +76,7 @@ void MeasureGPIOKeyCode() lastLatchStateGPIOKeyCode = latch; Serial.printf("GPIOKeyCode latch %d\n", latch); if (latch == 0) - client.publish(subjectGPIOKeyCodeStatetoMQTT, "done"); + pub(subjectGPIOKeyCodeStatetoMQTT, "done"); } // save the reading. Next time through the loop, it'll be the lastInputState: