From 3c5cbade635139c81ee1d248db1c95e84bfec10c Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:07:53 +0100 Subject: [PATCH] Restore iFan state text --- .../xdrv_01_9_webserver.ino | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino index 86a88d6d4..00fc1a7fe 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino @@ -1891,12 +1891,20 @@ bool HandleRootStatusRefresh(void) { XsnsXdrvCall(FUNC_WEB_SENSOR); WSContentSend_P(PSTR("")); - if (!Settings->flag6.gui_no_state_text) { // SetOption161 - (GUI) Disable display of state text (1) - bool show_state = (TasmotaGlobal.devices_present); + if (!Settings->flag6.gui_no_state_text && // SetOption161 - (GUI) Disable display of state text (1) + TasmotaGlobal.devices_present) { + #ifdef USE_SONOFF_IFAN - if (IsModuleIfan()) { show_state = false; } + if (IsModuleIfan()) { + WSContentSend_P(PSTR("{t}")); + WSContentSend_P(HTTP_DEVICE_STATE, 36, (bitRead(TasmotaGlobal.power, 0)) ? PSTR("bold") : PSTR("normal"), 54, GetStateText(bitRead(TasmotaGlobal.power, 0))); + uint32_t fanspeed = GetFanspeed(); + snprintf_P(svalue, sizeof(svalue), PSTR("%d"), fanspeed); + WSContentSend_P(HTTP_DEVICE_STATE, 64, (fanspeed) ? PSTR("bold") : PSTR("normal"), 54, (fanspeed) ? svalue : GetStateText(0)); + WSContentSend_P(PSTR("")); + } else { #endif // USE_SONOFF_IFAN - if (show_state) { + uint32_t buttons_non_light; uint32_t buttons_non_light_non_shutter; uint32_t shutter_button; @@ -1918,7 +1926,11 @@ bool HandleRootStatusRefresh(void) { } WSContentSend_P(PSTR("")); } + +#ifdef USE_SONOFF_IFAN } +#endif // USE_SONOFF_IFAN + } if (1 == Web.slider_update_time) {