mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-22 10:16:30 +00:00
Berry: 'webserver.content_status_sticker' attribute parameter added (#23466)
* Berry: 'webserver.content_status_sticker' attribute parameter added * fix optional parameter in comment
This commit is contained in:
parent
6853e88116
commit
553ee44b02
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user