unnecessary pub functions removing
and use OMG method instead of low level ones
This commit is contained in:
1 parent
1eebf138c2
commit
25375bb37c
2 files changed
+2
-4
No files matched your search
@@ -72,14 +72,12 @@ void MeasureGPIOInput()
|
|||||||
if (InputState == HIGH)
|
if (InputState == HIGH)
|
||||||
{
|
{
|
||||||
trc(F("GPIO HIGH"));
|
trc(F("GPIO HIGH"));
|
||||||
pub(subjectGPIOInputtoMQTT, "HIGH");
|
|
||||||
GPIOdata.set("gpio", "HIGH");
|
GPIOdata.set("gpio", "HIGH");
|
||||||
}
|
}
|
||||||
if (InputState == LOW)
|
if (InputState == LOW)
|
||||||
{
|
{
|
||||||
trc(F("GPIO LOW"));
|
trc(F("GPIO LOW"));
|
||||||
GPIOdata.set("gpio", "LOW");
|
GPIOdata.set("gpio", "LOW");
|
||||||
pub(subjectGPIOInputtoMQTT, "LOW");
|
|
||||||
}
|
}
|
||||||
if (GPIOdata.size() > 0)
|
if (GPIOdata.size() > 0)
|
||||||
pub(subjectGPIOInputtoMQTT, GPIOdata);
|
pub(subjectGPIOInputtoMQTT, GPIOdata);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ void MeasureGPIOKeyCode()
|
|||||||
sprintf(hex, "%02x", InputStateGPIOKeyCode);
|
sprintf(hex, "%02x", InputStateGPIOKeyCode);
|
||||||
hex[2] = 0;
|
hex[2] = 0;
|
||||||
Serial.printf("GPIOKeyCode %s\n", hex);
|
Serial.printf("GPIOKeyCode %s\n", hex);
|
||||||
client.publish(subjectGPIOKeyCodetoMQTT, hex);
|
pub(subjectGPIOKeyCodetoMQTT, hex);
|
||||||
lastLatchStateGPIOKeyCode = latch;
|
lastLatchStateGPIOKeyCode = latch;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ void MeasureGPIOKeyCode()
|
|||||||
lastLatchStateGPIOKeyCode = latch;
|
lastLatchStateGPIOKeyCode = latch;
|
||||||
Serial.printf("GPIOKeyCode latch %d\n", latch);
|
Serial.printf("GPIOKeyCode latch %d\n", latch);
|
||||||
if (latch == 0)
|
if (latch == 0)
|
||||||
client.publish(subjectGPIOKeyCodeStatetoMQTT, "done");
|
pub(subjectGPIOKeyCodeStatetoMQTT, "done");
|
||||||
}
|
}
|
||||||
|
|
||||||
// save the reading. Next time through the loop, it'll be the lastInputState:
|
// save the reading. Next time through the loop, it'll be the lastInputState:
|
||||||
|
|||||||
Reference in new issue
Block a user