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 31776d0d8..de2c1b0ba 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 @@ class Matter_Plugin_Bridge_Sensor_Illuminance : Matter_Plugin_Bridge_Sensor 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/embedded/Matter_Plugin_Sensor_Illuminance.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_Sensor_Illuminance.be index 0488a8e65..9aba03c57 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 @@ class Matter_Plugin_Sensor_Illuminance : Matter_Plugin_Sensor 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 051a2843e..d79f799b7 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 @@ be_local_closure(Matter_Plugin_Bridge_Sensor_Illuminance_read_attribute, /* na /* 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,7 +117,7 @@ be_local_closure(Matter_Plugin_Bridge_Sensor_Illuminance_read_attribute, /* na 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 @@ -125,7 +125,7 @@ be_local_closure(Matter_Plugin_Bridge_Sensor_Illuminance_read_attribute, /* na 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 9e1401e82..13bebe68c 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 @@ be_local_closure(Matter_Plugin_Sensor_Illuminance_read_attribute, /* name */ /* 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 @@ be_local_closure(Matter_Plugin_Sensor_Illuminance_read_attribute, /* name */ 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,7 +79,7 @@ be_local_closure(Matter_Plugin_Sensor_Illuminance_read_attribute, /* name */ 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