From 16b71af6f77531880cc2ceef043f412f44150e46 Mon Sep 17 00:00:00 2001 From: Gregg Date: Sun, 14 Aug 2022 18:14:41 -0500 Subject: [PATCH] Added button type to SpanButton HomeSpan Info --- src/HomeSpan.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/HomeSpan.cpp b/src/HomeSpan.cpp index 2a00d7c..95911b8 100644 --- a/src/HomeSpan.cpp +++ b/src/HomeSpan.cpp @@ -993,7 +993,18 @@ void Span::processSerialCommand(const char *c){ for(auto button=PushButtons.begin(); button!=PushButtons.end(); button++){ if((*button)->service==(*svc)){ - Serial.printf(" \u25bc SpanButton: Pin=%d, Single=%ums, Double=%ums, Long=%ums\n",(*button)->pin,(*button)->singleTime,(*button)->doubleTime,(*button)->longTime); + Serial.printf(" \u25bc SpanButton: Pin=%d, Single=%ums, Double=%ums, Long=%ums, Type=",(*button)->pin,(*button)->singleTime,(*button)->doubleTime,(*button)->longTime); + if((*button)->pressed==PushButton::GROUNDED) + Serial.printf("GROUNDED\n"); + else if((*button)->pressed==PushButton::POWERED) + Serial.printf("POWERED\n"); + +#if SOC_TOUCH_SENSOR_NUM > 0 + else if((*button)->pressed==PushButton::TOUCH) + Serial.printf("TOUCH\n"); +#endif + else + Serial.printf("USER-DEFINED\n"); if((void(*)(int,int))((*svc)->*(&SpanService::button))==(void(*)(int,int))(&SpanService::button)) Serial.printf(" *** WARNING! No button() method defined in this Service ***\n",nWarnings++);