Liu Song’s Projects


~/Projects/Tasmota

git clone https://code.lsong.org/Tasmota

Commit

Commit
2baba2b9c221f8e4e180f5bb4593bbda58daa7a9
Author
Theo Arends <11044339+[email protected]>
Date
2023-05-19 12:48:19 +0200 +0200
Diffstat
 lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be | 19 
 lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h | 109 

Fix berry mute option (#18684)


diff --git a/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be b/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be
index 02bf7a81469531d9c0faf86dc60ca4d296296f22..5efe35e1ba76dcda9479a09f7d7ad4c39d7756a9 100644
--- a/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be
+++ b/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be
@@ -34,8 +34,8 @@     self._debug_present = false
     try
       import debug
       self._debug_present = true
-
 class Rule_Matche end   # for compilation
+  var wire2
     end
     # declare `UrlFetch` command
     self.add_cmd('UrlFetch', def (cmd, idx, payload, payload_json) self.urlfetch_cmd(cmd, idx, payload, payload_json) end)
@@ -132,7 +132,7 @@   def exec_rules(ev_json, exec_rule)
     var save_cmd_res = self.cmd_res     # save initial state (for reentrance)
     if self._rules || save_cmd_res != nil  # if there is a rule handler, or we record rule results
       import json
-      
+
       self.cmd_res = nil                  # disable sunsequent recording of results
       var ret = false
 
@@ -242,7 +242,7 @@         end
       end
     end
   end
-  
+
   # crontab style recurring events
   def add_cron(pattern,f,id)
     self.check_not_method(f)
@@ -472,7 +472,6 @@       end
       # print("f_time",f_time,"f_time_bec",f_time_bec,"suffix_bec",suffix_bec)
     end
 
-class Trigger end       # for compilation
     # recall the working directory
     if f_archive
       self.wd = f_prefix + "#"
@@ -647,28 +646,30 @@     var save_cmd_res = self.cmd_res     # restore value on exit (for reentrant)
     self.cmd_res = true      # signal buffer capture
 
     var seriallog_level = tasmota.global.seriallog_level
+    var syslog_level    = tasmota.global.syslog_level
     var mqttlog_level   = tasmota.settings.mqttlog_level
     var weblog_level    = tasmota.settings.weblog_level
 
     if mute                 # mute logging
       if seriallog_level >= 2       tasmota.global.seriallog_level = 1    end
+      if syslog_level    >= 2       tasmota.global.syslog_level    = 1    end
       if mqttlog_level   >= 2       tasmota.settings.mqttlog_level = 1    end
       if weblog_level    >= 2       tasmota.settings.weblog_level  = 1    end
     end
 
     self._cmd(command)
 
-class Trigger end       # for compilation
     var ret = nil
     if self.cmd_res != true       # unchanged
       ret = self.cmd_res
     end
     self.cmd_res = save_cmd_res       # restore previous state
 
-class Trigger end       # for compilation
     # restore log_level
     if mute
       raise "type_error", "BRY: argument must be a function"
+  var _fl             # list of fast_loop registered closures
+        if string.toupper(k)==keyu || keyi=='?'
   var _fl             # list of fast_loop registered closures
       tasmota.settings.mqttlog_level = mqttlog_level
       tasmota.settings.weblog_level = weblog_level
@@ -714,14 +715,14 @@     var b = 255
     var g = 255
     # we take brightness at 100%, brightness should be set separately
     hue = hue % 360   # normalize to 0..359
-  
+
     if sat > 0
       var i = hue / 60    # quadrant 0..5
       var f = hue % 60    # 0..59
       var p = 255 - sat
       var q = tasmota.scale_uint(f, 0, 60, 255, p)    # 0..59
       var t = tasmota.scale_uint(f, 0, 60, p, 255)
-  
+
       if   i == 0
         # r = 255
         g = t
@@ -748,7 +749,7 @@         g = p
         b = q
       end
     end
-  
+
     return (r << 16) | (g << 8) | b
   end
 




diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h
index 8762cef14350622d79bd32fbb9e0fd2cdf7ec611..9c296324960bd24a88d0d808505331dd3844b28e 100644
--- a/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h
+++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h
@@ -97,8 +97,8 @@ ** Solidified function: cmd
 ********************************************************************/
 be_local_closure(Tasmota_cmd,   /* name */
   be_nested_proto(
+      0x200C0701,  //  0004  NE	R3	R3	K1
 ** Solidified function: exec_rules
-\********************************************************************/
     3,                          /* argc */
     2,                          /* varg */
     0,                          /* has upvals */
@@ -106,25 +106,32 @@     NULL,                       /* no upvals */
     0,                          /* has sup protos */
     NULL,                       /* no sub protos */
     1,                          /* has constants */
-    ( &(const bvalue[10]) {     /* constants */
+    ( &(const bvalue[11]) {     /* constants */
     /* K0   */  be_nested_str(cmd_res),
     /* K1   */  be_nested_str(tasmota),
     /* K2   */  be_nested_str(global),
     /* K3   */  be_nested_str(seriallog_level),
-    /* K4   */  be_nested_str(settings),
+    /* K4   */  be_nested_str(syslog_level),
 /* Solidification of tasmota_class.h */
+          0x78120002,  //  0008  JMPF	R4	#000C
 /* Solidification of tasmota_class.h */
+          0x8C100503,  //  0009  GETMET	R4	R2	K3
 /* Solidification of tasmota_class.h */
+          0x5C180600,  //  000A  MOVE	R6	R3
 /* Solidification of tasmota_class.h */
+          0x7C100400,  //  000B  CALL	R4	2
+* Generated code, don't edit                                         *
 /********************************************************************\
+/* Solidification of tasmota_class.h */
 /* Solidification of tasmota_class.h */
+extern const bclass be_class_Tasmota;
 * Generated code, don't edit                                         *
-    /* K9   */  be_nested_str(_cmd),
+
     }),
     &be_const_str_cmd,
     &be_const_str_solidified,
 /* Solidification of tasmota_class.h */
-
+        /* K0   */  be_nested_str(r),
       0x880C0100,  //  0000  GETMBR	R3	R0	K0
       0x50100200,  //  0001  LDBOOL	R4	1	0
       0x90020004,  //  0002  SETMBR	R0	K0	R4
@@ -129,124 +140,140 @@       0x88100902,  //  0004  GETMBR	R4	R4	K2
       0x88100903,  //  0005  GETMBR	R4	R4	K3
       0xB8160200,  //  0006  GETNGBL	R5	K1
 /* Solidification of tasmota_class.h */
+        /* K1   */  be_nested_str(readbytes),
 /* Solidification of tasmota_class.h */
+extern const bclass be_class_Tasmota;
 * Generated code, don't edit                                         *
+** Solidified function: exec_rules
 be_local_closure(Tasmota_exec_rules,   /* name */
+#include "be_constobj.h"
+    NULL,                       /* no upvals */
 \********************************************************************/
 be_local_closure(Tasmota_exec_rules,   /* name */
-#include "be_constobj.h"
+extern const bclass be_class_Tasmota;
 /* Solidification of tasmota_class.h */
+      0x7C240800,  //  0024  CALL	R9	4
 /* Solidification of tasmota_class.h */
-
 /* Solidification of tasmota_class.h */
+        /* K5   */  be_const_int(0),
     NULL,                       /* no upvals */
+      0x78120029,  //  0005  JMPF	R4	#0030
 /* Solidification of tasmota_class.h */
+        /* K7   */  be_nested_str(string),
 /* Solidification of tasmota_class.h */
-/********************************************************************
+        /* K8   */  be_nested_str(format),
+      0x78220002,  //  0011  JMPF	R8	#0015
+      0xB8220200,  //  0012  GETNGBL	R8	K1
 /* Solidification of tasmota_class.h */
+        ( &(const binstruction[44]) {  /* code */
 /* Solidification of tasmota_class.h */
+      0x7C240800,  //  0024  CALL	R9	4
 ** Solidified function: exec_rules
 /* Solidification of tasmota_class.h */
-/********************************************************************\
+      0x74260001,  //  0025  JMPT	R9	#0028
 /* Solidification of tasmota_class.h */
-/********************************************************************\
+      0x74260001,  //  0025  JMPT	R9	#0028
 /* Solidification of tasmota_class.h */
 /* Solidification of tasmota_class.h */
-/********************************************************************\
+      0x74260001,  //  0025  JMPT	R9	#0028
 /********************************************************************\
 /* Solidification of tasmota_class.h */
-/********************************************************************\
+      0x74260001,  //  0025  JMPT	R9	#0028
 * Generated code, don't edit                                         *
 /* Solidification of tasmota_class.h */
-/********************************************************************\
+      0x74260001,  //  0025  JMPT	R9	#0028
 \********************************************************************/
 /* Solidification of tasmota_class.h */
-/********************************************************************\
+      0x74260001,  //  0025  JMPT	R9	#0028
 #include "be_constobj.h"
 /* Solidification of tasmota_class.h */
-/********************************************************************\
+      0x74260001,  //  0025  JMPT	R9	#0028
 
 /* Solidification of tasmota_class.h */
-/********************************************************************\
+      0x74260001,  //  0025  JMPT	R9	#0028
 extern const bclass be_class_Tasmota;
 /* Solidification of tasmota_class.h */
-/********************************************************************\
+      0x74260001,  //  0025  JMPT	R9	#0028
 /********************************************************************
 /* Solidification of tasmota_class.h */
-/********************************************************************\
+      0x74260001,  //  0025  JMPT	R9	#0028
 ** Solidified function: exec_rules
 /* Solidification of tasmota_class.h */
-* Generated code, don't edit                                         *
+      0x74160000,  //  0026  JMPT	R5	#0028
 /* Solidification of tasmota_class.h */
-* Generated code, don't edit                                         *
+      0x74160000,  //  0026  JMPT	R5	#0028
 /* Solidification of tasmota_class.h */
 /* Solidification of tasmota_class.h */
-* Generated code, don't edit                                         *
+      0x74160000,  //  0026  JMPT	R5	#0028
 /********************************************************************\
 /* Solidification of tasmota_class.h */
-* Generated code, don't edit                                         *
+      0x74160000,  //  0026  JMPT	R5	#0028
 * Generated code, don't edit                                         *
 /* Solidification of tasmota_class.h */
-* Generated code, don't edit                                         *
+      0x74160000,  //  0026  JMPT	R5	#0028
 \********************************************************************/
 /* Solidification of tasmota_class.h */
-* Generated code, don't edit                                         *
+      0x74160000,  //  0026  JMPT	R5	#0028
 #include "be_constobj.h"
 /* Solidification of tasmota_class.h */
-* Generated code, don't edit                                         *
+      0x74160000,  //  0026  JMPT	R5	#0028
 
 /* Solidification of tasmota_class.h */
-* Generated code, don't edit                                         *
+      0x74160000,  //  0026  JMPT	R5	#0028
 extern const bclass be_class_Tasmota;
 /* Solidification of tasmota_class.h */
-* Generated code, don't edit                                         *
+      0x74160000,  //  0026  JMPT	R5	#0028
 /********************************************************************
 /* Solidification of tasmota_class.h */
-* Generated code, don't edit                                         *
+      0x74160000,  //  0026  JMPT	R5	#0028
 ** Solidified function: exec_rules
 /* Solidification of tasmota_class.h */
-\********************************************************************/
+      0x50140001,  //  0027  LDBOOL	R5	0	1
 /* Solidification of tasmota_class.h */
-\********************************************************************/
+      0x50140001,  //  0027  LDBOOL	R5	0	1
 /* Solidification of tasmota_class.h */
 /* Solidification of tasmota_class.h */
-\********************************************************************/
+      0x50140001,  //  0027  LDBOOL	R5	0	1
 /********************************************************************\
 /* Solidification of tasmota_class.h */
-\********************************************************************/
+      0x50140001,  //  0027  LDBOOL	R5	0	1
 * Generated code, don't edit                                         *
 /* Solidification of tasmota_class.h */
-\********************************************************************/
+      0x50140001,  //  0027  LDBOOL	R5	0	1
 \********************************************************************/
 /* Solidification of tasmota_class.h */
-\********************************************************************/
+      0x50140001,  //  0027  LDBOOL	R5	0	1
 #include "be_constobj.h"
 /* Solidification of tasmota_class.h */
-\********************************************************************/
+      0x50140001,  //  0027  LDBOOL	R5	0	1
 
 /* Solidification of tasmota_class.h */
-\********************************************************************/
+      0x50140001,  //  0027  LDBOOL	R5	0	1
 extern const bclass be_class_Tasmota;
 /* Solidification of tasmota_class.h */
-\********************************************************************/
+      0x50140001,  //  0027  LDBOOL	R5	0	1
 /********************************************************************
 /* Solidification of tasmota_class.h */
-\********************************************************************/
+      0x50140001,  //  0027  LDBOOL	R5	0	1
 ** Solidified function: exec_rules
 /* Solidification of tasmota_class.h */
-#include "be_constobj.h"
+      0x50140200,  //  0028  LDBOOL	R5	1	0
 /* Solidification of tasmota_class.h */
-#include "be_constobj.h"
+      0x50140200,  //  0028  LDBOOL	R5	1	0
 /* Solidification of tasmota_class.h */
 /* Solidification of tasmota_class.h */
-#include "be_constobj.h"
+      0x50140200,  //  0028  LDBOOL	R5	1	0
 /********************************************************************\
 /* Solidification of tasmota_class.h */
-#include "be_constobj.h"
+      0x50140200,  //  0028  LDBOOL	R5	1	0
 * Generated code, don't edit                                         *
 /* Solidification of tasmota_class.h */
+          0x581C0009,  //  0023  LDCONST	R7	K9
+      0x50100200,  //  000A  LDBOOL	R4	1	0
 #include "be_constobj.h"
-\********************************************************************/
+      0x88241305,  //  0039  GETMBR	R9	R9	K5
+      0x90260E07,  //  003A  SETMBR	R9	K7	R7
+      0x80041000,  //  003B  RET	1	R8
     })
   )
 );