add channel type BatteryLevelPercent

This commit is contained in:
openshwprojects
2022-12-13 10:49:48 +01:00
parent 654659f15c
commit b16a8cec5e
3 changed files with 12 additions and 1 deletions

View File

@ -545,6 +545,15 @@ int http_fn_index(http_request_t* request) {
hprintf255(request, "Current %fA (ch %i)", fValue, i);
poststr(request, "</td></tr>");
}
else if (channelType == ChType_BatteryLevelPercent) {
iValue = CHANNEL_Get(i);
poststr(request, "<tr><td>");
hprintf255(request, "Battery level: %i", iValue);
poststr(request, "%");
hprintf255(request, " (ch %i)", i);
poststr(request, "</td></tr>");
}
else if (channelType == ChType_OpenClosed) {
iValue = CHANNEL_Get(i);