add two new channel types - only cosmetic for display - "OpenClosed" and "OpenClosed_Inv" - for door sensors, garage door sensors, etc

This commit is contained in:
openshwprojects
2022-11-19 10:20:54 +01:00
parent 25ffbe7725
commit 827b2c7ed7
3 changed files with 32 additions and 0 deletions

View File

@ -534,6 +534,30 @@ int http_fn_index(http_request_t* request) {
hprintf255(request, "Current %fA (ch %i)", fValue, i);
poststr(request, "</td></tr>");
}
else if (channelType == ChType_OpenClosed) {
iValue = CHANNEL_Get(i);
poststr(request, "<tr><td>");
if (iValue) {
hprintf255(request, "CLOSED (ch %i)", i);
}
else {
hprintf255(request, "OPEN (ch %i)", i);
}
poststr(request, "</td></tr>");
}
else if (channelType == ChType_OpenClosed_Inv) {
iValue = CHANNEL_Get(i);
poststr(request, "<tr><td>");
if (!iValue) {
hprintf255(request, "CLOSED (ch %i)", i);
}
else {
hprintf255(request, "OPEN (ch %i)", i);
}
poststr(request, "</td></tr>");
}
else if (h_isChannelRelay(i) || channelType == ChType_Toggle) {
const char* c;
if (i <= 1) {