mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-09 07:55:39 +00:00
some wemo progress based on the input from user - thx
This commit is contained in:
@ -780,12 +780,26 @@ int http_fn_index(http_request_t* request) {
|
||||
{
|
||||
hprintf255(request, "<h5>Wifi RSSI: %s (%idBm)</h5>", str_rssi[wifi_rssi_scale(HAL_GetWifiStrength())], HAL_GetWifiStrength());
|
||||
}
|
||||
hprintf255(request, "<h5>MQTT State: %s RES: %d(%s)<br>", (Main_HasMQTTConnected() == 1) ? "connected" : "disconnected",
|
||||
MQTT_GetConnectResult(), get_error_name(MQTT_GetConnectResult()));
|
||||
hprintf255(request, "MQTT ErrMsg: %s <br>", (MQTT_GetStatusMessage() != NULL) ? MQTT_GetStatusMessage() : "");
|
||||
hprintf255(request, "MQTT Stats:CONN: %d PUB: %d RECV: %d ERR: %d </h5>", MQTT_GetConnectEvents(),
|
||||
MQTT_GetPublishEventCounter(), MQTT_GetReceivedEventCounter(), MQTT_GetPublishErrorCounter());
|
||||
|
||||
if (CFG_GetMQTTHost()[0] == 0) {
|
||||
hprintf255(request, "<h5>MQTT State: not configured<br>");
|
||||
}
|
||||
else {
|
||||
const char *stateStr;
|
||||
const char *colorStr;
|
||||
if (Main_HasMQTTConnected() == 1) {
|
||||
stateStr = "connected";
|
||||
colorStr = "green";
|
||||
}
|
||||
else {
|
||||
stateStr = "disconnected";
|
||||
colorStr = "yellow";
|
||||
}
|
||||
hprintf255(request, "<h5>MQTT State: <span style=\"color:%s\">%s</span> RES: %d(%s)<br>", colorStr,
|
||||
stateStr,MQTT_GetConnectResult(), get_error_name(MQTT_GetConnectResult()));
|
||||
hprintf255(request, "MQTT ErrMsg: %s <br>", (MQTT_GetStatusMessage() != NULL) ? MQTT_GetStatusMessage() : "");
|
||||
hprintf255(request, "MQTT Stats:CONN: %d PUB: %d RECV: %d ERR: %d </h5>", MQTT_GetConnectEvents(),
|
||||
MQTT_GetPublishEventCounter(), MQTT_GetReceivedEventCounter(), MQTT_GetPublishErrorCounter());
|
||||
}
|
||||
/* Format current PINS input state for all unused pins */
|
||||
if (CFG_HasFlag(OBK_FLAG_HTTP_PINMONITOR))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user