Berry add tasmota.urlbecload(url:string) -> bool (#20412)

This commit is contained in:
s-hadinger 2024-01-06 17:32:50 +01:00 committed by GitHub
parent 15b40801d4
commit ea6b191378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
### Added
- HASPmota type `chart` (#20372)
- Berry add support for `tcpclientasync` in `tcpserver`
- Berry add `tasmota.urlbecload(url:string) -> bool`
### Breaking Changed

View File

@ -6,6 +6,7 @@
#include "be_constobj.h"
#include "be_ctypes.h"
#include "be_mapping.h"
#include "be_ctypes.h"
extern struct TasmotaGlobal_t TasmotaGlobal;
extern struct TSettings * Settings;
@ -69,6 +70,9 @@ extern int tasm_apply_str_op(bvm *vm);
extern int32_t be_Tasmota_version(void);
BE_FUNC_CTYPE_DECLARE(be_Tasmota_version, "i", "-");
extern bbool BerryBECLoader(const char * url);
BE_FUNC_CTYPE_DECLARE(BerryBECLoader, "b", "s")
#include "solidify/solidified_tasmota_class.h"
#include "solidify/solidified_rule_matcher.h"
#include "solidify/solidified_trigger_class.h"
@ -177,6 +181,7 @@ class be_class_tasmota (scope: global, name: Tasmota) {
time_str, closure(Tasmota_time_str_closure)
urlfetch, closure(Tasmota_urlfetch_closure)
urlfetch_cmd, closure(Tasmota_urlfetch_cmd_closure)
urlbecload, static_ctype_func(BerryBECLoader)
add_cron, closure(Tasmota_add_cron_closure)
run_cron, closure(Tasmota_run_cron_closure)

View File

@ -778,6 +778,7 @@ void HandleBerryPartiionWizardLoaderButton(void) {
}
}
extern "C" bbool BerryBECLoader(const char * url);
void HandleBerryPartitionWizardLoader(void) {
if (BerryBECLoader(USE_BERRY_PARTITION_WIZARD_URL)) {
// All good, redirect
@ -792,7 +793,7 @@ void HandleBerryPartitionWizardLoader(void) {
#endif //USE_BERRY_PARTITION_WIZARD
// return true if successful
bool BerryBECLoader(const char * url) {
extern "C" bbool BerryBECLoader(const char * url) {
bvm *vm = berry.vm;
HTTPClientLight cl;