Add undocumented feature

This commit is contained in:
Theo Arends 2023-05-25 17:13:31 +02:00
parent e932902351
commit e05d75248e
4 changed files with 10 additions and 3 deletions

View File

@ -186,7 +186,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
uint32_t no_voltage_common : 1; // bit 4 (v12.3.1.5) - SetOption150 - (Energy) Force no voltage/frequency common uint32_t no_voltage_common : 1; // bit 4 (v12.3.1.5) - SetOption150 - (Energy) Force no voltage/frequency common
uint32_t matter_enabled : 1; // bit 5 (v12.3.1.5) - SetOption151 - (Matter) Enable Matter protocol over Wifi uint32_t matter_enabled : 1; // bit 5 (v12.3.1.5) - SetOption151 - (Matter) Enable Matter protocol over Wifi
uint32_t bistable_single_pin : 1; // bit 6 (v12.5.0.1) - SetOption152 - (Power) Switch between two (0) or one (1) pin bistable relay control uint32_t bistable_single_pin : 1; // bit 6 (v12.5.0.1) - SetOption152 - (Power) Switch between two (0) or one (1) pin bistable relay control
uint32_t spare07 : 1; // bit 7 uint32_t berry_autoexec : 1; // bit 7 (v12.5.0.3) - SetOption153 - (Berry) Disable autoexec.be on restart (1)
uint32_t spare08 : 1; // bit 8 uint32_t spare08 : 1; // bit 8
uint32_t spare09 : 1; // bit 9 uint32_t spare09 : 1; // bit 9
uint32_t spare10 : 1; // bit 10 uint32_t spare10 : 1; // bit 10

View File

@ -1474,6 +1474,7 @@ void CmndSetoptionBase(bool indexed) {
switch (pindex) { switch (pindex) {
case 5: // SetOption151 - Matter enabled case 5: // SetOption151 - Matter enabled
case 6: // SetOption152 - (Power) Use single pin bistable case 6: // SetOption152 - (Power) Use single pin bistable
case 7: // SetOption153 - (Berry) Disable autoexec.be on restart (1)
TasmotaGlobal.restart_flag = 2; TasmotaGlobal.restart_flag = 2;
break; break;
} }

View File

@ -378,6 +378,12 @@ void BerryInit(void) {
void BrLoad(const char * script_name) { void BrLoad(const char * script_name) {
if (berry.vm == nullptr || TasmotaGlobal.no_autoexec) { return; } // abort is berry is not running, or bootloop prevention kicked in if (berry.vm == nullptr || TasmotaGlobal.no_autoexec) { return; } // abort is berry is not running, or bootloop prevention kicked in
if (!strcmp_P(script_name, "autoexec.be")) {
if (Settings->flag6.berry_autoexec) { // SetOption153 - (Berry) Disable autoexec.be on restart (1)
return;
}
}
be_getglobal(berry.vm, PSTR("load")); be_getglobal(berry.vm, PSTR("load"));
if (!be_isnil(berry.vm, -1)) { if (!be_isnil(berry.vm, -1)) {
be_pushstring(berry.vm, script_name); be_pushstring(berry.vm, script_name);

View File

@ -208,7 +208,7 @@ a_setoption = [[
"(Energy) Force no voltage/frequency common", "(Energy) Force no voltage/frequency common",
"(Matter) Enable Matter protocol over Wifi", "(Matter) Enable Matter protocol over Wifi",
"(Power) Switch between two (0) or one (1) pin bistable relay control", "(Power) Switch between two (0) or one (1) pin bistable relay control",
"", "(Berry) Disable autoexec.be on restart (1)",
"","","","", "","","","",
"","","","", "","","","",
"","","","", "","","","",
@ -325,7 +325,7 @@ else:
obj = json.load(fp) obj = json.load(fp)
def StartDecode(): def StartDecode():
print ("\n*** decode-status.py v12.5.0.2 by Theo Arends and Jacek Ziolkowski ***") print ("\n*** decode-status.py v12.5.0.3 by Theo Arends and Jacek Ziolkowski ***")
# print("Decoding\n{}".format(obj)) # print("Decoding\n{}".format(obj))