From 6325a9fb440c255f7b7a913cfc554bd117641535 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sat, 27 Sep 2025 10:21:39 +0200 Subject: [PATCH] Berry add argument to `werbserver.content_send_style` (#23953) --- CHANGELOG.md | 1 + .../tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc6fdfded..b49b2cd30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. ### Changed - ESP32 Platform from 2025.08.30 to 2025.09.30, Framework (Arduino Core) from v3.1.3.250808 to v3.1.4 and IDF from v5.3.3.250801 to v5.3.4.250826 (#23888) - Use HAL instead of ROM for SHA HW acceleration as used by TLS (#23902) +- Berry add argument to `werbserver.content_send_style` ### Fixed 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 3a9170e58..5b34bb73d 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino @@ -268,11 +268,17 @@ extern "C" { be_raise(vm, kTypeError, nullptr); } - // Berry: `webserver.content_send_style() -> nil` + // Berry: `webserver.content_send_style([style : string]) -> nil` // int32_t w_webserver_content_send_style(struct bvm *vm); int32_t w_webserver_content_send_style(struct bvm *vm) { - WSContentSendStyle(); + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 1 && be_isstring(vm, 1)) { + const char * head_content = be_tostring(vm, 1); + WSContentSendStyle_P("%s", head_content); + } else { + WSContentSendStyle(); + } be_return_nil(vm); }