From f72a98997630d6785e375245b95a46fe7350f380 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Wed, 30 Apr 2025 10:06:48 +0200 Subject: [PATCH] WebUI status line Berry tapp for Wifi and Free Heap (#23358) --- tasmota/berry/modules/Webui_Status.tapp | Bin 0 -> 2009 bytes .../berry/modules/webui_status/autoexec.be | 3 ++ .../modules/webui_status/webui_status.be | 37 ++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 tasmota/berry/modules/Webui_Status.tapp create mode 100644 tasmota/berry/modules/webui_status/autoexec.be create mode 100644 tasmota/berry/modules/webui_status/webui_status.be diff --git a/tasmota/berry/modules/Webui_Status.tapp b/tasmota/berry/modules/Webui_Status.tapp new file mode 100644 index 0000000000000000000000000000000000000000..9675e3c0da0f2ed3de3a3ba6deb906d91f66ea82 GIT binary patch literal 2009 zcmbtV&2G~`5O!$+ksc5d2M&Nnse)5fyGcu-Bux=Nty;Cvhz3>kVr}A0v*6ffcipB$ zJ#gXyxc7v34&DOZg9}Gy>^MK9RF!bF_GWgznQv!jcB)&GQyGJv=FaK<_b(@{F3xF8 z8@CM>>40~5!>;o;wQI&?_2-Qiji@tiOicZrFpR02s5%3(4ST#E31?R`9VuJ0Ff7AI z5rXv&tit#r9L4G?R-eD05$!OLdPJHz@Paz?Y-d;%Dx*5pKL1~@PWQiB_UD^d41>mX zQq*4}QfIeVMyn^4IBKG_wek3GJcP5#+O=(KwzT-_=am%~oE z#l=BOC-X2+LW{sJN$#QTLw=H?m~3=I=DNZ^C>6?mJyutN7inIu2h!!Tv=DXxCBg+Q znXf`7xvzVRmSnDoRB5S@%cUY6gjOT)0$Iwbfv-Z3A6iT4E#efFOT_|CJl;gY#jrDg z6nl_|0|-qC@+d_-9tJF=F&J`Eq&Yzzq!6?*@UfUe{tjDAEQKJ`0Yo-z)}TOklK@$$ zI=11J`SgVFh+N*pBoI13OXsDTY6qIx7$ zi4)9NCn*YtQp};C_Dl>)L~)5ei3!X=nzocdu}C!g-bj`=qtJ|LqdJ;Tz;+|>HD-aM zka4~l$TrjQChW74c5Yyi*W=8{FTjlTd}rHP-+BGgnwdRAqqy8tscqJ_*HC9RWkIze zl@eIYX($t>B)lNk?20Q6A+ErRNoW(a&>pXtuXlGhA?N0DbNB}LS=+>##9FJE{Zav{ zhyuOK=IXE^EGS@$kW(n0M+f7J3+F8s&s!`&l5~C3v4iYfd}wr*=RKow`VcWs=wlPZ zP9eLPi8$h`6|k0;;0a_CGFd1=_JSPx1|Aju)4=i=gI;b>`A`@JY2BntxP_N+EdN*j z;&mD_fAyYUS7EuE2CIz~D39|d!5uPW&Yrx-x+c|ZoQ&j;hU7Yu{>W91Raf1bxO8{& zU+wW0cE05K`iZ_H&GK^6EdOdU!v@Fu)v&?uXb?Ax9W}WP;_ih;&*)s$t;^W%4C501 LzTx-IRr>b_5z0q? literal 0 HcmV?d00001 diff --git a/tasmota/berry/modules/webui_status/autoexec.be b/tasmota/berry/modules/webui_status/autoexec.be new file mode 100644 index 000000000..5e2f597e3 --- /dev/null +++ b/tasmota/berry/modules/webui_status/autoexec.be @@ -0,0 +1,3 @@ +# rm Webui_Status.tapp; zip -j -0 Webui_Status.tapp webui_status/* +import webui_status +global._webui_status = webui_status diff --git a/tasmota/berry/modules/webui_status/webui_status.be b/tasmota/berry/modules/webui_status/webui_status.be new file mode 100644 index 000000000..dd8070e27 --- /dev/null +++ b/tasmota/berry/modules/webui_status/webui_status.be @@ -0,0 +1,37 @@ +# display Wifi and Free Heap in the Web Status line +class webui_status + static var HTTP_HEAD_STYLE_WIFI = + "" + + def init() + tasmota.add_driver(self) + end + + def remove() + tasmota.remove_driver(self) + end + def web_status_line_left() + import webserver + # display wifi + if tasmota.wifi('up') + webserver.content_send(format(self.HTTP_HEAD_STYLE_WIFI, tasmota.webcolor(2 #-COL_FORM-#), tasmota.webcolor(18 #-COL_TITLE-#))) + var rssi = tasmota.wifi('rssi') + webserver.content_send(format("
", + tasmota.wifi('quality'), rssi, + rssi >= -55 ? "active" : "", + rssi >= -70 ? "active" : "", + rssi >= -85 ? "active" : "")) + end + # display free heap + webserver.content_send(f" {tasmota.memory('heap_free')}k") + end +end +return webui_status()