From 553ee44b02b09026b711e102ed347f50038ce364 Mon Sep 17 00:00:00 2001 From: Fabrizio Amodio <32312585+ZioFabry@users.noreply.github.com> Date: Fri, 23 May 2025 22:42:59 +0200 Subject: [PATCH] Berry: 'webserver.content_status_sticker' attribute parameter added (#23466) * Berry: 'webserver.content_status_sticker' attribute parameter added * fix optional parameter in comment --- tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino index 491af7aa9..0853eb75a 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino @@ -403,14 +403,18 @@ extern "C" { be_raise(vm, kTypeError, nullptr); } - // Berry: `webserver.content_status_sticker(msg:string) -> nil` + // Berry: `webserver.content_status_sticker(msg:string [,attr:string]) -> nil` // int32_t w_webserver_content_status_sticker(struct bvm *vm) { #ifdef USE_WEB_STATUS_LINE int32_t argc = be_top(vm); // Get the number of arguments if (argc >= 1 && be_isstring(vm, 1)) { const char * msg = be_tostring(vm, 1); - WSContentStatusSticker(msg); + const char * attr = nullptr; + if (argc >= 2 && be_isstring(vm, 2)) { + attr = be_tostring(vm, 2); + } + WSContentStatusSticker(msg, attr); be_return_nil(vm); } be_raise(vm, kTypeError, nullptr);