diff --git a/tasmota/xdrv_86_esp32_sonoff_spm.ino b/tasmota/xdrv_86_esp32_sonoff_spm.ino index 226b983c4..a72515466 100644 --- a/tasmota/xdrv_86_esp32_sonoff_spm.ino +++ b/tasmota/xdrv_86_esp32_sonoff_spm.ino @@ -2095,47 +2095,47 @@ void SSPMEnergyShow(bool json) { ResponseAppend_P(PSTR("]}")); #ifdef USE_WEBSERVER } else { - uint8_t relay[SSPM_MAX_MODULES * 4]; + uint8_t relays[SSPM_MAX_MODULES * 4]; uint8_t indirect[SSPM_MAX_MODULES * 4]; - uint32_t index = 0; + uint32_t relay_show = 0; power_t power = TasmotaGlobal.power; for (uint32_t i = 0; i < TasmotaGlobal.devices_present; i++) { if ((0 == Sspm->Settings.flag.display) || ((1 == Sspm->Settings.flag.display) && (power >> i) &1) || (2 == Sspm->Settings.flag.display)) { - relay[index] = i +1; - indirect[index] = i; - index++; + relays[relay_show] = i +1; + indirect[relay_show] = i; + relay_show++; } } - if (index) { + if (relay_show) { if (Sspm->Settings.flag.display != 2) { - if (index > 4) { + if (relay_show > 4) { Sspm->rotate++; } else { Sspm->rotate = 0; } } - if (Sspm->rotate > ((index -1) | 0x3)) { // Always test in case index has changed due to use of SspmDisplay command + if (Sspm->rotate > ((relay_show -1) | 0x3)) { // Always test in case relay has changed due to use of SspmDisplay command Sspm->rotate = 0; } uint32_t offset = (Sspm->rotate >> 2) * 4; - uint32_t count = index - offset; + uint32_t count = relay_show - offset; if (count > 4) { count = 4; } - WSContentSend_P(PSTR("
"), // &k86 is related to WebGetArg("k", tmp, sizeof(tmp)); - cols_width, (current_module == idx) ? WebColor(COL_BACKGROUND) : WebColor(COL_FORM), idx, (idx *4) +1); + WSContentSend_P(PSTR(" | "), // &k86 is related to WebGetArg("k", tmp, sizeof(tmp)); + cols_width, (current_module == idx) ? WebColor(COL_BACKGROUND) : WebColor(COL_FORM), (current_module == idx) ? "bold" : "normal", idx, (idx *4) +1); } - WSContentSend_P(PSTR(" |