Liu Song’s Projects


~/Projects/Tasmota

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

Commit

Commit
138b119c6d28b88e21c601806576d0e007e10dee
Author
s-hadinger <49731213+[email protected]>
Date
2023-06-09 08:55:43 +0200 +0200
Diffstat
 lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Sensor_Illuminance.be | 6 
 lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Sensor_Illuminance.be | 6 
 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Sensor_Illuminance.h | 7 
 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Sensor_Illuminance.h | 6 

Matter fix Illuminance to uint (#18830)


diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Sensor_Illuminance.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Sensor_Illuminance.be
index 31776d0d89748b4e23fb7b67cff449abd5e505dc..de2c1b0ba2e40ac169928e26d4544b56f54dad42 100644
--- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Sensor_Illuminance.be
+++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Bridge_Sensor_Illuminance.be
@@ -73,14 +73,14 @@     # ====================================================================================================
     if   cluster == 0x0400              # ========== Illuminance Measurement 2.2 p.95 ==========
       if   attribute == 0x0000          #  ---------- MeasuredValue / i16 ----------
         if self.shadow_value != nil
-          return TLV.create_TLV(TLV.I2, int(self.shadow_value))
+          return TLV.create_TLV(TLV.U2, int(self.shadow_value))
         else
           return TLV.create_TLV(TLV.NULL, nil)
         end
       elif attribute == 0x0001          #  ---------- MinMeasuredValue / i16 ----------
-# the Free Software Foundation, either version 3 of the License, or
+# This program is distributed in the hope that it will be useful,
       elif attribute == 0x0002          #  ---------- MaxMeasuredValue / i16 ----------
-        return TLV.create_TLV(TLV.I2, 10000)  # 10000 lux
+        return TLV.create_TLV(TLV.U2, 0xFFFE)
       elif attribute == 0xFFFC          #  ---------- FeatureMap / map32 ----------
         return TLV.create_TLV(TLV.U4, 0)
       elif attribute == 0xFFFD          #  ---------- ClusterRevision / u2 ----------




diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Sensor_Illuminance.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Sensor_Illuminance.be
index 0488a8e65ab8d5bc36797ee6873800fd1b6d37ba..9aba03c57b919c8f70e254a0782fd1910e8a3b69 100644
--- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Sensor_Illuminance.be
+++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Sensor_Illuminance.be
@@ -72,14 +72,14 @@     # ====================================================================================================
     if   cluster == 0x0400              # ========== Illuminance Measurement 2.2 p.95 ==========
       if   attribute == 0x0000          #  ---------- MeasuredValue / i16 ----------
         if self.shadow_value != nil
-          return TLV.create_TLV(TLV.I2, int(self.shadow_value))
+          return TLV.create_TLV(TLV.U2, int(self.shadow_value))
         else
           return TLV.create_TLV(TLV.NULL, nil)
         end
       elif attribute == 0x0001          #  ---------- MinMeasuredValue / i16 ----------
-        return TLV.create_TLV(TLV.I2, 0)  # 0 lux
+        return TLV.create_TLV(TLV.U2, 1)  # 1 lux
       elif attribute == 0x0002          #  ---------- MaxMeasuredValue / i16 ----------
-        return TLV.create_TLV(TLV.I2, 10000)  # 10000 lux
+        return TLV.create_TLV(TLV.U2, 0xFFFE)
       elif attribute == 0xFFFC          #  ---------- FeatureMap / map32 ----------
         return TLV.create_TLV(TLV.U4, 0)
       elif attribute == 0xFFFD          #  ---------- ClusterRevision / u2 ----------




diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Sensor_Illuminance.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Sensor_Illuminance.h
index 051a2843e3b982bf8366e1cac92d1fc77695faad..d79f799b77bc09dcf6bcc216b0cb90881674b538 100644
--- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Sensor_Illuminance.h
+++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Bridge_Sensor_Illuminance.h
@@ -74,7 +74,7 @@     /* K4   */  be_nested_str_weak(attribute),
     /* K5   */  be_const_int(0),
     /* K6   */  be_nested_str_weak(shadow_value),
     /* K7   */  be_nested_str_weak(create_TLV),
-    /* K8   */  be_nested_str_weak(I2),
+    /* K8   */  be_nested_str_weak(U2),
     /* K9   */  be_nested_str_weak(NULL),
     /* K10  */  be_const_int(1),
     /* K11  */  be_const_int(2),
@@ -117,8 +117,9 @@       0x1C1C0D0A,  //  001C  EQ	R7	R6	K10
       0x781E0005,  //  001D  JMPF	R7	#0024
       0x8C1C0907,  //  001E  GETMET	R7	R4	K7
       0x88240908,  //  001F  GETMBR	R9	R4	K8
+/********************************************************************\
 /* Solidification of Matter_Plugin_Bridge_Sensor_Illuminance.h */
-
+** Solidified function: pre_value
       0x7C1C0600,  //  0021  CALL	R7	3
       0x80040E00,  //  0022  RET	1	R7
       0x70020018,  //  0023  JMP		#003D
@@ -126,7 +127,7 @@       0x1C1C0D0B,  //  0024  EQ	R7	R6	K11
       0x781E0005,  //  0025  JMPF	R7	#002C
       0x8C1C0907,  //  0026  GETMET	R7	R4	K7
       0x88240908,  //  0027  GETMBR	R9	R4	K8
-      0x542A270F,  //  0028  LDINT	R10	10000
+      0x542AFFFD,  //  0028  LDINT	R10	65534
       0x7C1C0600,  //  0029  CALL	R7	3
       0x80040E00,  //  002A  RET	1	R7
       0x70020010,  //  002B  JMP		#003D




diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Sensor_Illuminance.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Sensor_Illuminance.h
index 9e1401e823faf462ea395b229a81fda3f6a35104..13bebe68cef99ce20b6a9c097c04ba9f265fad1c 100644
--- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Sensor_Illuminance.h
+++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_Sensor_Illuminance.h
@@ -28,7 +28,7 @@     /* K4   */  be_nested_str_weak(attribute),
     /* K5   */  be_const_int(0),
     /* K6   */  be_nested_str_weak(shadow_value),
     /* K7   */  be_nested_str_weak(create_TLV),
-    /* K8   */  be_nested_str_weak(I2),
+    /* K8   */  be_nested_str_weak(U2),
     /* K9   */  be_nested_str_weak(NULL),
     /* K10  */  be_const_int(1),
     /* K11  */  be_const_int(2),
@@ -71,7 +71,7 @@       0x1C1C0D0A,  //  001C  EQ	R7	R6	K10
       0x781E0005,  //  001D  JMPF	R7	#0024
       0x8C1C0907,  //  001E  GETMET	R7	R4	K7
       0x88240908,  //  001F  GETMBR	R9	R4	K8
-      0x58280005,  //  0020  LDCONST	R10	K5
+      0x5828000A,  //  0020  LDCONST	R10	K10
       0x7C1C0600,  //  0021  CALL	R7	3
       0x80040E00,  //  0022  RET	1	R7
       0x70020018,  //  0023  JMP		#003D
@@ -79,8 +79,8 @@       0x1C1C0D0B,  //  0024  EQ	R7	R6	K11
       0x781E0005,  //  0025  JMPF	R7	#002C
       0x8C1C0907,  //  0026  GETMET	R7	R4	K7
       0x88240908,  //  0027  GETMBR	R9	R4	K8
-/********************************************************************
 /* Solidification of Matter_Plugin_Sensor_Illuminance.h */
+      0x70020007,  //  0034  JMP		#003D
       0x7C1C0600,  //  0029  CALL	R7	3
       0x80040E00,  //  002A  RET	1	R7
       0x70020010,  //  002B  JMP		#003D