From 2cf0eda87056cc4c030dba251709fd2e82aef82b Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sat, 15 Jun 2024 12:51:08 +0200 Subject: [PATCH] Matter add Fan support (virtual only) (#21637) * Matter add Fan support (virtual only) * Add MtrReceived event --- CHANGELOG.md | 1 + .../berry_matter/src/be_matter_module.c | 2 + .../src/embedded/Matter_Plugin_0.be | 3 +- .../embedded/Matter_Plugin_1_Aggregator.be | 2 +- .../src/embedded/Matter_Plugin_1_Device.be | 2 +- .../src/embedded/Matter_Plugin_1_Root.be | 2 +- .../src/embedded/Matter_Plugin_2_Fan.be | 198 ++++++ .../Matter_Plugin_3_Sensor_Waterleak.be | 2 +- .../Matter_Plugin_8_Bridge_Sensor_Rain.be | 2 +- .../src/embedded/Matter_Plugin_9_Virt_Fan.be | 33 + .../berry_matter/src/embedded/Matter_UI.be | 1 + .../src/solidify/solidified_Matter_Plugin_0.h | 5 +- .../solidify/solidified_Matter_Plugin_2_Fan.h | 570 ++++++++++++++++++ .../solidified_Matter_Plugin_9_Virt_Fan.h | 27 + .../src/solidify/solidified_Matter_UI.h | 2 +- .../solidify/solidified_Matter_zz_Device.h | 92 +-- 16 files changed, 890 insertions(+), 54 deletions(-) create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Fan.be create mode 100644 lib/libesp32/berry_matter/src/embedded/Matter_Plugin_9_Virt_Fan.be create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Fan.h create mode 100644 lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_9_Virt_Fan.h diff --git a/CHANGELOG.md b/CHANGELOG.md index e942a6dd8747..008adf3e3ce5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. - Extend command ``SetOption147 1`` to disable publish of IRReceived MQTT messages (#21574) - Matter support for Rain sensor (#21633) - Matter add internal debug option +- Matter add Fan support (virtual only) ### Breaking Changed diff --git a/lib/libesp32/berry_matter/src/be_matter_module.c b/lib/libesp32/berry_matter/src/be_matter_module.c index a641cad332e1..8e8f5d36c32a 100644 --- a/lib/libesp32/berry_matter/src/be_matter_module.c +++ b/lib/libesp32/berry_matter/src/be_matter_module.c @@ -258,6 +258,8 @@ extern const bclass be_class_Matter_TLV; // need to declare it upfront because #include "solidify/solidified_Matter_Plugin_3_Sensor_Contact.h" #include "solidify/solidified_Matter_Plugin_3_Sensor_Rain.h" #include "solidify/solidified_Matter_Plugin_3_Sensor_Waterleak.h" +#include "solidify/solidified_Matter_Plugin_2_Fan.h" +#include "solidify/solidified_Matter_Plugin_9_Virt_Fan.h" #include "solidify/solidified_Matter_Plugin_9_Virt_Sensor_Contact.h" #include "solidify/solidified_Matter_Plugin_9_Virt_Sensor_Occupancy.h" #include "solidify/solidified_Matter_Plugin_9_Virt_Sensor_Rain.h" diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be index 56b6eba63cad..42e436513e35 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be @@ -1,5 +1,5 @@ # -# Matter_Plugin.be - generic superclass for all Matter plugins, used to define specific behaviors (light, switch, media...) +# Matter_Plugin_0.be - generic superclass for all Matter plugins, used to define specific behaviors (light, switch, media...) # # Copyright (C) 2023 Stephan Hadinger & Theo Arends # @@ -48,6 +48,7 @@ class Matter_Plugin static var FEATURE_MAPS = { # feature map per cluster 0x0031: 0x04, # Put Eth for now which should work for any on-network 0x0102: 1 + 4, # Lift + PA_LF + 0x0202: 2, # Fan: Auto } # `CLUSTER_REVISIONS` contains revision numbers for each cluster, or `1` if not present static var CLUSTER_REVISIONS = { diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Aggregator.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Aggregator.be index 6e87717367f9..2e45e036e39f 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Aggregator.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Aggregator.be @@ -1,5 +1,5 @@ # -# Matter_Plugin_Aggregator.be - implements the Aggregator endpoint +# Matter_Plugin_1_Aggregator.be - implements the Aggregator endpoint # # Copyright (C) 2023 Stephan Hadinger & Theo Arends # diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be index e9834cff5412..edae4f0641e0 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Device.be @@ -1,5 +1,5 @@ # -# Matter_Plugin_Device.be - implements the behavior for a standard Device +# Matter_Plugin_1_Device.be - implements the behavior for a standard Device # # Copyright (C) 2023 Stephan Hadinger & Theo Arends # diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Root.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Root.be index d58b6436f766..c6abb638b5f6 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Root.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Root.be @@ -1,5 +1,5 @@ # -# Matter_Plugin_Root.be - implements the core features that a Matter device must implemment +# Matter_Plugin_1_Root.be - implements the core features that a Matter device must implemment # # Copyright (C) 2023 Stephan Hadinger & Theo Arends # diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Fan.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Fan.be new file mode 100644 index 000000000000..dbdc97797e2e --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_2_Fan.be @@ -0,0 +1,198 @@ +# +# Matter_Plugin_2_Fan.be - implements the behavior for a generic Fan +# +# Copyright (C) 2023 Stephan Hadinger & Theo Arends +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import matter + +# Matter plug-in for core behavior + +#@ solidify:Matter_Plugin_Fan,weak + +class Matter_Plugin_Fan : Matter_Plugin_Device + static var TYPE = "fan" # name of the plug-in in json + static var DISPLAY_NAME = "Fan" # display name of the plug-in + # static var ARG = "" # additional argument name (or empty if none) + static var CLUSTERS = matter.consolidate_clusters(_class, { + # 0x001D: inherited # Descriptor Cluster 9.5 p.453 + # 0x0003: inherited # Identify 1.2 p.16 + # 0x0004: inherited # Groups 1.3 p.21 + # 0x0005: inherited # Scenes 1.4 p.30 - no writable + 0x0202: [0,1,2,3], # Fan + }) + static var UPDATE_COMMANDS = matter.UC_LIST(_class, "FanMode", "FanSpeed") + static var TYPES = { 0x002B: 2 } # Fan + + # Inherited + # var device # reference to the `device` global object + # var endpoint # current endpoint + # var clusters # map from cluster to list of attributes, typically constructed from CLUSTERS hierachy + # var tick # tick value when it was last updated + # var node_label # name of the endpoint, used only in bridge mode, "" if none + var shadow_fan_mode + var shadow_fan_speed_pct + ############################################################# + # FanMode: + # 0: Off + # 1: Low + # 2: Medium + # 3: High + # 4: On -- deprecated + # 5: Auto -- not declared as supported + # 6: Smart -- deprecated + + ############################################################# + # Constructor + def init(device, endpoint, config) + super(self).init(device, endpoint, config) + self.shadow_fan_mode = 0 # Off by default + self.shadow_fan_speed_pct = 0 + end + + ############################################################# + # Model + # + def set_fan_mode(fan_mode) + fan_mode = int(fan_mode) + if (fan_mode < 0) fan_mode = 0 end # force positive + if fan_mode != self.shadow_fan_mode + self.attribute_updated(0x0202, 0x0000) + self.shadow_fan_mode = int(fan_mode) + # compute new speed + var new_speed_pct = self.shadow_fan_speed_pct + if self.shadow_fan_mode == 0 # set to Off, we need to adjust speed to 0 (4.4.6.1.1) + new_speed_pct = 0 + elif self.shadow_fan_mode > 3 # Auto mode or unsupported modes, since we don't support AUTO, set speed to max + self.shadow_fan_mode = 3 # HIGH + new_speed_pct = 100 + else # set to value + new_speed_pct = tasmota.scale_uint(fan_mode, 0, 3, 0, 100) + end + # adjust and advertize if speed changed + if self.shadow_fan_speed_pct != new_speed_pct + self.shadow_fan_speed_pct = new_speed_pct + self.attribute_updated(0x0202, 0x0002) + end + end + end + + def set_fan_speed_pct(fan_speed_pct) + # guard value + fan_speed_pct = int(fan_speed_pct) + if (fan_speed_pct < 0) fan_speed_pct = 0 end + if (fan_speed_pct > 100) fan_speed_pct = 100 end + if fan_speed_pct != self.shadow_fan_speed_pct + self.attribute_updated(0x0202, 0x0002) + self.shadow_fan_speed_pct = fan_speed_pct + # adjust mode if needed + var new_mode = self.shadow_fan_mode + if (fan_speed_pct == 0) + new_mode = 0 + else + new_mode = tasmota.scale_uint(fan_speed_pct, 1, 100, 1, 3) + end + # adjust and advertize if mode changed + if (new_mode != self.shadow_fan_mode) + self.shadow_fan_mode = new_mode + self.attribute_updated(0x0202, 0x0000) + end + end + end + + ############################################################# + # read an attribute + # + def read_attribute(session, ctx, tlv_solo) + var TLV = matter.TLV + var cluster = ctx.cluster + var attribute = ctx.attribute + + # ==================================================================================================== + if cluster == 0x0202 # ========== Fan ========== + self.update_shadow_lazy() + if attribute == 0x0000 # ---------- FanMode / enum8 ---------- + return tlv_solo.set(TLV.U1, self.shadow_fan_mode) + elif attribute == 0x0001 # ---------- FanModeSequence / enum8 ---------- + return tlv_solo.set(TLV.U1, 2) # Off/Low/Med/High/Auto + elif attribute == 0x0002 # ---------- PercentSetting / enum8 ---------- + return tlv_solo.set(TLV.U1, self.shadow_fan_speed_pct) + elif attribute == 0x0003 # ---------- PercentSetting / enum8 ---------- + return tlv_solo.set(TLV.U1, self.shadow_fan_speed_pct) + end + + end + return super(self).read_attribute(session, ctx, tlv_solo) + end + + ############################################################# + # MVC Model + # + # Controller write attributes + ############################################################# + ############################################################# + # write attribute + def write_attribute(session, ctx, write_data) + var TLV = matter.TLV + var cluster = ctx.cluster + var attribute = ctx.attribute + + # ==================================================================================================== + if cluster == 0x0202 # ========== Fan ========== + self.update_shadow_lazy() + if attribute == 0x0000 # ---------- FanMode / enum8 ---------- + if type(write_data) == 'int' + self.set_fan_mode(write_data) + self.publish_command('FanMode', self.shadow_fan_mode, 'FanSpeed', self.shadow_fan_speed_pct) + return true + else + ctx.status = matter.CONSTRAINT_ERROR + return false + end + elif attribute == 0x0002 # ---------- PercentSetting / enum8 ---------- + if type(write_data) == 'int' + self.set_fan_speed_pct(write_data) + self.publish_command('FanMode', self.shadow_fan_mode, 'FanSpeed', self.shadow_fan_speed_pct) + return true + else + ctx.status = matter.CONSTRAINT_ERROR + return false + end + end + + end + # return super(self).read_attribute(session, ctx, tlv_solo) # not useful as there is nothing in superclass + return nil + end + + ############################################################# + # update_virtual + # + # Update internal state for virtual devices + def update_virtual(payload) + var val_fan_mode = payload.find("FanMode") + if val_fan_mode != nil + self.set_fan_mode(int(val_fan_mode)) + end + var val_fan_speed = payload.find("FanSpeed") + if val_fan_speed != nil + self.set_fan_speed_pct(int(val_fan_speed)) + end + # super(self).update_virtual(payload) # not useful as there is nothing in superclass + end + +end +matter.Plugin_Fan = Matter_Plugin_Fan diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Waterleak.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Waterleak.be index 3b82427563e5..4a140e27ea76 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Waterleak.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_3_Sensor_Waterleak.be @@ -1,5 +1,5 @@ # -# Matter_Plugin_3_Sensor_Waterleak.be - implements the behavior for a Water leak Sensor +# Matter_Plugin_2_Sensor_Waterleak.be - implements the behavior for a Water leak Sensor # # Copyright (C) 2024 Stephan Hadinger & Theo Arends # diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_8_Bridge_Sensor_Rain.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_8_Bridge_Sensor_Rain.be index b9a275eb10cf..2c024d38a1ba 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_8_Bridge_Sensor_Rain.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_8_Bridge_Sensor_Rain.be @@ -1,5 +1,5 @@ # -# Matter_Plugin_Bridge_8_Sensor_Rain.be - implements Rain Sensor via HTTP to Tasmota +# Matter_Plugin_Bridge_Sensor_Rain.be - implements Rain Sensor via HTTP to Tasmota # # Copyright (C) 2024 Stephan Hadinger & Theo Arends # diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_9_Virt_Fan.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_9_Virt_Fan.be new file mode 100644 index 000000000000..0e7f4341a299 --- /dev/null +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_9_Virt_Fan.be @@ -0,0 +1,33 @@ +# +# Matter_Plugin_Virt_Fan.be - implements the behavior for a Virtual Fan +# +# Copyright (C) 2023 Stephan Hadinger & Theo Arends +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import matter + +# Matter plug-in for core behavior + +#@ solidify:Matter_Plugin_Virt_Fan,weak + +class Matter_Plugin_Virt_Fan : Matter_Plugin_Fan + static var TYPE = "v_fan" # name of the plug-in in json + static var DISPLAY_NAME = "v.Fan" # display name of the plug-in + static var ARG = "" # no arg for virtual device + static var ARG_HINT = "_Not used_" # Hint for entering the Argument (inside 'placeholder') + static var VIRTUAL = true # virtual device +end +matter.Plugin_Virt_Fan = Matter_Plugin_Virt_Fan diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_UI.be b/lib/libesp32/berry_matter/src/embedded/Matter_UI.be index 29bf665fa3bf..6f917ed6b8c2 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_UI.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_UI.be @@ -36,6 +36,7 @@ class Matter_UI "|temperature|pressure|illuminance|humidity|occupancy|onoff|contact|flow|rain|waterleak" "|airquality" "|-virtual|v_relay|v_light0|v_light1|v_light2|v_light3" + "|v_fan" "|v_temp|v_pressure|v_illuminance|v_humidity|v_occupancy|v_contact|v_flow|v_rain|v_waterleak" "|v_airquality" static var _CLASSES_TYPES2= "|http_relay|http_light0|http_light1|http_light2|http_light3" diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h index 27ec870937b9..401fd4429aa7 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h @@ -1359,10 +1359,11 @@ be_local_class(Matter_Plugin, be_nested_map(51, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_weak(FEATURE_MAPS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { - be_const_map( * be_nested_map(2, + be_const_map( * be_nested_map(3, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_int(258, -1), be_const_int(5) }, - { be_const_key_int(49, -1), be_const_int(4) }, + { be_const_key_int(49, 2), be_const_int(4) }, + { be_const_key_int(514, -1), be_const_int(2) }, })) ) } )) }, { be_const_key_weak(append_state_json, -1), be_const_closure(class_Matter_Plugin_append_state_json_closure) }, { be_const_key_weak(parse_configuration, -1), be_const_closure(class_Matter_Plugin_parse_configuration_closure) }, diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Fan.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Fan.h new file mode 100644 index 000000000000..739c5d9f4ff8 --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_2_Fan.h @@ -0,0 +1,570 @@ +/* Solidification of Matter_Plugin_2_Fan.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Plugin_Fan; + +/******************************************************************** +** Solidified function: set_fan_mode +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Fan; +be_local_closure(class_Matter_Plugin_Fan_set_fan_mode, /* name */ + be_nested_proto( + 10, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Fan, + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(shadow_fan_mode), + /* K2 */ be_nested_str_weak(attribute_updated), + /* K3 */ be_nested_str_weak(shadow_fan_speed_pct), + /* K4 */ be_const_int(3), + /* K5 */ be_nested_str_weak(tasmota), + /* K6 */ be_nested_str_weak(scale_uint), + /* K7 */ be_const_int(2), + }), + be_str_weak(set_fan_mode), + &be_const_str_solidified, + ( &(const binstruction[48]) { /* code */ + 0x60080009, // 0000 GETGBL R2 G9 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x5C040400, // 0003 MOVE R1 R2 + 0x14080300, // 0004 LT R2 R1 K0 + 0x780A0000, // 0005 JMPF R2 #0007 + 0x58040000, // 0006 LDCONST R1 K0 + 0x88080101, // 0007 GETMBR R2 R0 K1 + 0x20080202, // 0008 NE R2 R1 R2 + 0x780A0024, // 0009 JMPF R2 #002F + 0x8C080102, // 000A GETMET R2 R0 K2 + 0x54120201, // 000B LDINT R4 514 + 0x58140000, // 000C LDCONST R5 K0 + 0x7C080600, // 000D CALL R2 3 + 0x60080009, // 000E GETGBL R2 G9 + 0x5C0C0200, // 000F MOVE R3 R1 + 0x7C080200, // 0010 CALL R2 1 + 0x90020202, // 0011 SETMBR R0 K1 R2 + 0x88080103, // 0012 GETMBR R2 R0 K3 + 0x880C0101, // 0013 GETMBR R3 R0 K1 + 0x1C0C0700, // 0014 EQ R3 R3 K0 + 0x780E0001, // 0015 JMPF R3 #0018 + 0x58080000, // 0016 LDCONST R2 K0 + 0x7002000E, // 0017 JMP #0027 + 0x880C0101, // 0018 GETMBR R3 R0 K1 + 0x240C0704, // 0019 GT R3 R3 K4 + 0x780E0002, // 001A JMPF R3 #001E + 0x90020304, // 001B SETMBR R0 K1 K4 + 0x540A0063, // 001C LDINT R2 100 + 0x70020008, // 001D JMP #0027 + 0xB80E0A00, // 001E GETNGBL R3 K5 + 0x8C0C0706, // 001F GETMET R3 R3 K6 + 0x5C140200, // 0020 MOVE R5 R1 + 0x58180000, // 0021 LDCONST R6 K0 + 0x581C0004, // 0022 LDCONST R7 K4 + 0x58200000, // 0023 LDCONST R8 K0 + 0x54260063, // 0024 LDINT R9 100 + 0x7C0C0C00, // 0025 CALL R3 6 + 0x5C080600, // 0026 MOVE R2 R3 + 0x880C0103, // 0027 GETMBR R3 R0 K3 + 0x200C0602, // 0028 NE R3 R3 R2 + 0x780E0004, // 0029 JMPF R3 #002F + 0x90020602, // 002A SETMBR R0 K3 R2 + 0x8C0C0102, // 002B GETMET R3 R0 K2 + 0x54160201, // 002C LDINT R5 514 + 0x58180007, // 002D LDCONST R6 K7 + 0x7C0C0600, // 002E CALL R3 3 + 0x80000000, // 002F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: update_virtual +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Fan; +be_local_closure(class_Matter_Plugin_Fan_update_virtual, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Fan, + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(find), + /* K1 */ be_nested_str_weak(FanMode), + /* K2 */ be_nested_str_weak(set_fan_mode), + /* K3 */ be_nested_str_weak(FanSpeed), + /* K4 */ be_nested_str_weak(set_fan_speed_pct), + }), + be_str_weak(update_virtual), + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0x8C080300, // 0000 GETMET R2 R1 K0 + 0x58100001, // 0001 LDCONST R4 K1 + 0x7C080400, // 0002 CALL R2 2 + 0x4C0C0000, // 0003 LDNIL R3 + 0x200C0403, // 0004 NE R3 R2 R3 + 0x780E0004, // 0005 JMPF R3 #000B + 0x8C0C0102, // 0006 GETMET R3 R0 K2 + 0x60140009, // 0007 GETGBL R5 G9 + 0x5C180400, // 0008 MOVE R6 R2 + 0x7C140200, // 0009 CALL R5 1 + 0x7C0C0400, // 000A CALL R3 2 + 0x8C0C0300, // 000B GETMET R3 R1 K0 + 0x58140003, // 000C LDCONST R5 K3 + 0x7C0C0400, // 000D CALL R3 2 + 0x4C100000, // 000E LDNIL R4 + 0x20100604, // 000F NE R4 R3 R4 + 0x78120004, // 0010 JMPF R4 #0016 + 0x8C100104, // 0011 GETMET R4 R0 K4 + 0x60180009, // 0012 GETGBL R6 G9 + 0x5C1C0600, // 0013 MOVE R7 R3 + 0x7C180200, // 0014 CALL R6 1 + 0x7C100400, // 0015 CALL R4 2 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_fan_speed_pct +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Fan; +be_local_closure(class_Matter_Plugin_Fan_set_fan_speed_pct, /* name */ + be_nested_proto( + 10, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Fan, + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(shadow_fan_speed_pct), + /* K2 */ be_nested_str_weak(attribute_updated), + /* K3 */ be_const_int(2), + /* K4 */ be_nested_str_weak(shadow_fan_mode), + /* K5 */ be_nested_str_weak(tasmota), + /* K6 */ be_nested_str_weak(scale_uint), + /* K7 */ be_const_int(1), + /* K8 */ be_const_int(3), + }), + be_str_weak(set_fan_speed_pct), + &be_const_str_solidified, + ( &(const binstruction[42]) { /* code */ + 0x60080009, // 0000 GETGBL R2 G9 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x5C040400, // 0003 MOVE R1 R2 + 0x14080300, // 0004 LT R2 R1 K0 + 0x780A0000, // 0005 JMPF R2 #0007 + 0x58040000, // 0006 LDCONST R1 K0 + 0x540A0063, // 0007 LDINT R2 100 + 0x24080202, // 0008 GT R2 R1 R2 + 0x780A0000, // 0009 JMPF R2 #000B + 0x54060063, // 000A LDINT R1 100 + 0x88080101, // 000B GETMBR R2 R0 K1 + 0x20080202, // 000C NE R2 R1 R2 + 0x780A001A, // 000D JMPF R2 #0029 + 0x8C080102, // 000E GETMET R2 R0 K2 + 0x54120201, // 000F LDINT R4 514 + 0x58140003, // 0010 LDCONST R5 K3 + 0x7C080600, // 0011 CALL R2 3 + 0x90020201, // 0012 SETMBR R0 K1 R1 + 0x88080104, // 0013 GETMBR R2 R0 K4 + 0x1C0C0300, // 0014 EQ R3 R1 K0 + 0x780E0001, // 0015 JMPF R3 #0018 + 0x58080000, // 0016 LDCONST R2 K0 + 0x70020008, // 0017 JMP #0021 + 0xB80E0A00, // 0018 GETNGBL R3 K5 + 0x8C0C0706, // 0019 GETMET R3 R3 K6 + 0x5C140200, // 001A MOVE R5 R1 + 0x58180007, // 001B LDCONST R6 K7 + 0x541E0063, // 001C LDINT R7 100 + 0x58200007, // 001D LDCONST R8 K7 + 0x58240008, // 001E LDCONST R9 K8 + 0x7C0C0C00, // 001F CALL R3 6 + 0x5C080600, // 0020 MOVE R2 R3 + 0x880C0104, // 0021 GETMBR R3 R0 K4 + 0x200C0403, // 0022 NE R3 R2 R3 + 0x780E0004, // 0023 JMPF R3 #0029 + 0x90020802, // 0024 SETMBR R0 K4 R2 + 0x8C0C0102, // 0025 GETMET R3 R0 K2 + 0x54160201, // 0026 LDINT R5 514 + 0x58180000, // 0027 LDCONST R6 K0 + 0x7C0C0600, // 0028 CALL R3 3 + 0x80000000, // 0029 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: write_attribute +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Fan; +be_local_closure(class_Matter_Plugin_Fan_write_attribute, /* name */ + be_nested_proto( + 13, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Fan, + 1, /* has constants */ + ( &(const bvalue[17]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(cluster), + /* K3 */ be_nested_str_weak(attribute), + /* K4 */ be_nested_str_weak(update_shadow_lazy), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(int), + /* K7 */ be_nested_str_weak(set_fan_mode), + /* K8 */ be_nested_str_weak(publish_command), + /* K9 */ be_nested_str_weak(FanMode), + /* K10 */ be_nested_str_weak(shadow_fan_mode), + /* K11 */ be_nested_str_weak(FanSpeed), + /* K12 */ be_nested_str_weak(shadow_fan_speed_pct), + /* K13 */ be_nested_str_weak(status), + /* K14 */ be_nested_str_weak(CONSTRAINT_ERROR), + /* K15 */ be_const_int(2), + /* K16 */ be_nested_str_weak(set_fan_speed_pct), + }), + be_str_weak(write_attribute), + &be_const_str_solidified, + ( &(const binstruction[60]) { /* code */ + 0xB8120000, // 0000 GETNGBL R4 K0 + 0x88100901, // 0001 GETMBR R4 R4 K1 + 0x88140502, // 0002 GETMBR R5 R2 K2 + 0x88180503, // 0003 GETMBR R6 R2 K3 + 0x541E0201, // 0004 LDINT R7 514 + 0x1C1C0A07, // 0005 EQ R7 R5 R7 + 0x781E0032, // 0006 JMPF R7 #003A + 0x8C1C0104, // 0007 GETMET R7 R0 K4 + 0x7C1C0200, // 0008 CALL R7 1 + 0x1C1C0D05, // 0009 EQ R7 R6 K5 + 0x781E0016, // 000A JMPF R7 #0022 + 0x601C0004, // 000B GETGBL R7 G4 + 0x5C200600, // 000C MOVE R8 R3 + 0x7C1C0200, // 000D CALL R7 1 + 0x1C1C0F06, // 000E EQ R7 R7 K6 + 0x781E000B, // 000F JMPF R7 #001C + 0x8C1C0107, // 0010 GETMET R7 R0 K7 + 0x5C240600, // 0011 MOVE R9 R3 + 0x7C1C0400, // 0012 CALL R7 2 + 0x8C1C0108, // 0013 GETMET R7 R0 K8 + 0x58240009, // 0014 LDCONST R9 K9 + 0x8828010A, // 0015 GETMBR R10 R0 K10 + 0x582C000B, // 0016 LDCONST R11 K11 + 0x8830010C, // 0017 GETMBR R12 R0 K12 + 0x7C1C0A00, // 0018 CALL R7 5 + 0x501C0200, // 0019 LDBOOL R7 1 0 + 0x80040E00, // 001A RET 1 R7 + 0x70020004, // 001B JMP #0021 + 0xB81E0000, // 001C GETNGBL R7 K0 + 0x881C0F0E, // 001D GETMBR R7 R7 K14 + 0x900A1A07, // 001E SETMBR R2 K13 R7 + 0x501C0000, // 001F LDBOOL R7 0 0 + 0x80040E00, // 0020 RET 1 R7 + 0x70020017, // 0021 JMP #003A + 0x1C1C0D0F, // 0022 EQ R7 R6 K15 + 0x781E0015, // 0023 JMPF R7 #003A + 0x601C0004, // 0024 GETGBL R7 G4 + 0x5C200600, // 0025 MOVE R8 R3 + 0x7C1C0200, // 0026 CALL R7 1 + 0x1C1C0F06, // 0027 EQ R7 R7 K6 + 0x781E000B, // 0028 JMPF R7 #0035 + 0x8C1C0110, // 0029 GETMET R7 R0 K16 + 0x5C240600, // 002A MOVE R9 R3 + 0x7C1C0400, // 002B CALL R7 2 + 0x8C1C0108, // 002C GETMET R7 R0 K8 + 0x58240009, // 002D LDCONST R9 K9 + 0x8828010A, // 002E GETMBR R10 R0 K10 + 0x582C000B, // 002F LDCONST R11 K11 + 0x8830010C, // 0030 GETMBR R12 R0 K12 + 0x7C1C0A00, // 0031 CALL R7 5 + 0x501C0200, // 0032 LDBOOL R7 1 0 + 0x80040E00, // 0033 RET 1 R7 + 0x70020004, // 0034 JMP #003A + 0xB81E0000, // 0035 GETNGBL R7 K0 + 0x881C0F0E, // 0036 GETMBR R7 R7 K14 + 0x900A1A07, // 0037 SETMBR R2 K13 R7 + 0x501C0000, // 0038 LDBOOL R7 0 0 + 0x80040E00, // 0039 RET 1 R7 + 0x4C1C0000, // 003A LDNIL R7 + 0x80040E00, // 003B RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Fan; +be_local_closure(class_Matter_Plugin_Fan_init, /* name */ + be_nested_proto( + 9, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Fan, + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(init), + /* K1 */ be_nested_str_weak(shadow_fan_mode), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(shadow_fan_speed_pct), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0x60100003, // 0000 GETGBL R4 G3 + 0x5C140000, // 0001 MOVE R5 R0 + 0x7C100200, // 0002 CALL R4 1 + 0x8C100900, // 0003 GETMET R4 R4 K0 + 0x5C180200, // 0004 MOVE R6 R1 + 0x5C1C0400, // 0005 MOVE R7 R2 + 0x5C200600, // 0006 MOVE R8 R3 + 0x7C100800, // 0007 CALL R4 4 + 0x90020302, // 0008 SETMBR R0 K1 K2 + 0x90020702, // 0009 SETMBR R0 K3 K2 + 0x80000000, // 000A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read_attribute +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Fan; +be_local_closure(class_Matter_Plugin_Fan_read_attribute, /* name */ + be_nested_proto( + 12, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + &be_class_Matter_Plugin_Fan, + 1, /* has constants */ + ( &(const bvalue[14]) { /* constants */ + /* K0 */ be_nested_str_weak(matter), + /* K1 */ be_nested_str_weak(TLV), + /* K2 */ be_nested_str_weak(cluster), + /* K3 */ be_nested_str_weak(attribute), + /* K4 */ be_nested_str_weak(update_shadow_lazy), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(set), + /* K7 */ be_nested_str_weak(U1), + /* K8 */ be_nested_str_weak(shadow_fan_mode), + /* K9 */ be_const_int(1), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str_weak(shadow_fan_speed_pct), + /* K12 */ be_const_int(3), + /* K13 */ be_nested_str_weak(read_attribute), + }), + be_str_weak(read_attribute), + &be_const_str_solidified, + ( &(const binstruction[49]) { /* code */ + 0xB8120000, // 0000 GETNGBL R4 K0 + 0x88100901, // 0001 GETMBR R4 R4 K1 + 0x88140502, // 0002 GETMBR R5 R2 K2 + 0x88180503, // 0003 GETMBR R6 R2 K3 + 0x541E0201, // 0004 LDINT R7 514 + 0x1C1C0A07, // 0005 EQ R7 R5 R7 + 0x781E0020, // 0006 JMPF R7 #0028 + 0x8C1C0104, // 0007 GETMET R7 R0 K4 + 0x7C1C0200, // 0008 CALL R7 1 + 0x1C1C0D05, // 0009 EQ R7 R6 K5 + 0x781E0005, // 000A JMPF R7 #0011 + 0x8C1C0706, // 000B GETMET R7 R3 K6 + 0x88240907, // 000C GETMBR R9 R4 K7 + 0x88280108, // 000D GETMBR R10 R0 K8 + 0x7C1C0600, // 000E CALL R7 3 + 0x80040E00, // 000F RET 1 R7 + 0x70020016, // 0010 JMP #0028 + 0x1C1C0D09, // 0011 EQ R7 R6 K9 + 0x781E0005, // 0012 JMPF R7 #0019 + 0x8C1C0706, // 0013 GETMET R7 R3 K6 + 0x88240907, // 0014 GETMBR R9 R4 K7 + 0x5828000A, // 0015 LDCONST R10 K10 + 0x7C1C0600, // 0016 CALL R7 3 + 0x80040E00, // 0017 RET 1 R7 + 0x7002000E, // 0018 JMP #0028 + 0x1C1C0D0A, // 0019 EQ R7 R6 K10 + 0x781E0005, // 001A JMPF R7 #0021 + 0x8C1C0706, // 001B GETMET R7 R3 K6 + 0x88240907, // 001C GETMBR R9 R4 K7 + 0x8828010B, // 001D GETMBR R10 R0 K11 + 0x7C1C0600, // 001E CALL R7 3 + 0x80040E00, // 001F RET 1 R7 + 0x70020006, // 0020 JMP #0028 + 0x1C1C0D0C, // 0021 EQ R7 R6 K12 + 0x781E0004, // 0022 JMPF R7 #0028 + 0x8C1C0706, // 0023 GETMET R7 R3 K6 + 0x88240907, // 0024 GETMBR R9 R4 K7 + 0x8828010B, // 0025 GETMBR R10 R0 K11 + 0x7C1C0600, // 0026 CALL R7 3 + 0x80040E00, // 0027 RET 1 R7 + 0x601C0003, // 0028 GETGBL R7 G3 + 0x5C200000, // 0029 MOVE R8 R0 + 0x7C1C0200, // 002A CALL R7 1 + 0x8C1C0F0D, // 002B GETMET R7 R7 K13 + 0x5C240200, // 002C MOVE R9 R1 + 0x5C280400, // 002D MOVE R10 R2 + 0x5C2C0600, // 002E MOVE R11 R3 + 0x7C1C0800, // 002F CALL R7 4 + 0x80040E00, // 0030 RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Matter_Plugin_Fan +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Device; +be_local_class(Matter_Plugin_Fan, + 2, + &be_class_Matter_Plugin_Device, + be_nested_map(13, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(update_virtual, -1), be_const_closure(class_Matter_Plugin_Fan_update_virtual_closure) }, + { be_const_key_weak(read_attribute, 3), be_const_closure(class_Matter_Plugin_Fan_read_attribute_closure) }, + { be_const_key_weak(TYPE, 0), be_nested_str_weak(fan) }, + { be_const_key_weak(UPDATE_COMMANDS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(2, + ( (struct bvalue*) &(const bvalue[]) { + be_nested_str_weak(FanMode), + be_nested_str_weak(FanSpeed), + })) ) } )) }, + { be_const_key_weak(shadow_fan_speed_pct, -1), be_const_var(1) }, + { be_const_key_weak(set_fan_speed_pct, -1), be_const_closure(class_Matter_Plugin_Fan_set_fan_speed_pct_closure) }, + { be_const_key_weak(shadow_fan_mode, 8), be_const_var(0) }, + { be_const_key_weak(write_attribute, -1), be_const_closure(class_Matter_Plugin_Fan_write_attribute_closure) }, + { be_const_key_weak(init, 9), be_const_closure(class_Matter_Plugin_Fan_init_closure) }, + { be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(Fan) }, + { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(6, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_int(5, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(12, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(3), + be_const_int(4), + be_const_int(5), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(4, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(7, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(57, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(12, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(3), + be_const_int(5), + be_const_int(10), + be_const_int(15), + be_const_int(17), + be_const_int(18), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(3, 2), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(8, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(514, 1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(10, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(3), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + { be_const_key_int(29, 0), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + be_const_list( * be_nested_list(10, + ( (struct bvalue*) &(const bvalue[]) { + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(3), + be_const_int(65528), + be_const_int(65529), + be_const_int(65530), + be_const_int(65531), + be_const_int(65532), + be_const_int(65533), + })) ) } )) }, + })) ) } )) }, + { be_const_key_weak(set_fan_mode, 1), be_const_closure(class_Matter_Plugin_Fan_set_fan_mode_closure) }, + { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_int(43, -1), be_const_int(2) }, + })) ) } )) }, + })), + be_str_weak(Matter_Plugin_Fan) +); +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_9_Virt_Fan.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_9_Virt_Fan.h new file mode 100644 index 000000000000..be063b2e9c0d --- /dev/null +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_9_Virt_Fan.h @@ -0,0 +1,27 @@ +/* Solidification of Matter_Plugin_9_Virt_Fan.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +extern const bclass be_class_Matter_Plugin_Virt_Fan; + +/******************************************************************** +** Solidified class: Matter_Plugin_Virt_Fan +********************************************************************/ +extern const bclass be_class_Matter_Plugin_Fan; +be_local_class(Matter_Plugin_Virt_Fan, + 0, + &be_class_Matter_Plugin_Fan, + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(VIRTUAL, 3), be_const_bool(1) }, + { be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(v_X2EFan) }, + { be_const_key_weak(TYPE, -1), be_nested_str_weak(v_fan) }, + { be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(_Not_X20used_) }, + { be_const_key_weak(ARG, 2), be_nested_str_weak() }, + })), + be_str_weak(Matter_Plugin_Virt_Fan) +); +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h index 93f389557af5..b2d5e1d38b31 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h @@ -3397,7 +3397,7 @@ be_local_class(Matter_UI, { be_const_key_weak(show_commissioning_info, -1), be_const_closure(class_Matter_UI_show_commissioning_info_closure) }, { be_const_key_weak(page_part_ctl, 18), be_const_closure(class_Matter_UI_page_part_ctl_closure) }, { be_const_key_weak(show_fabric_info, -1), be_const_closure(class_Matter_UI_show_fabric_info_closure) }, - { be_const_key_weak(_CLASSES_TYPES, 4), be_nested_str_long(_X7Crelay_X7Clight0_X7Clight1_X7Clight2_X7Clight3_X7Cshutter_X7Cshutter_X2Btilt_X7Ctemperature_X7Cpressure_X7Cilluminance_X7Chumidity_X7Coccupancy_X7Conoff_X7Ccontact_X7Cflow_X7Crain_X7Cwaterleak_X7Cairquality_X7C_X2Dvirtual_X7Cv_relay_X7Cv_light0_X7Cv_light1_X7Cv_light2_X7Cv_light3_X7Cv_temp_X7Cv_pressure_X7Cv_illuminance_X7Cv_humidity_X7Cv_occupancy_X7Cv_contact_X7Cv_flow_X7Cv_rain_X7Cv_waterleak_X7Cv_airquality) }, + { be_const_key_weak(_CLASSES_TYPES, 4), be_nested_str_long(_X7Crelay_X7Clight0_X7Clight1_X7Clight2_X7Clight3_X7Cshutter_X7Cshutter_X2Btilt_X7Ctemperature_X7Cpressure_X7Cilluminance_X7Chumidity_X7Coccupancy_X7Conoff_X7Ccontact_X7Cflow_X7Crain_X7Cwaterleak_X7Cairquality_X7C_X2Dvirtual_X7Cv_relay_X7Cv_light0_X7Cv_light1_X7Cv_light2_X7Cv_light3_X7Cv_fan_X7Cv_temp_X7Cv_pressure_X7Cv_illuminance_X7Cv_humidity_X7Cv_occupancy_X7Cv_contact_X7Cv_flow_X7Cv_rain_X7Cv_waterleak_X7Cv_airquality) }, { be_const_key_weak(web_get_arg, -1), be_const_closure(class_Matter_UI_web_get_arg_closure) }, { be_const_key_weak(plugin_option, 5), be_const_closure(class_Matter_UI_plugin_option_closure) }, { be_const_key_weak(web_add_config_button, -1), be_const_closure(class_Matter_UI_web_add_config_button_closure) }, diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h index d5787e6c37f6..d7855d907796 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h @@ -6104,58 +6104,60 @@ be_local_class(Matter_Device, { be_const_key_weak(probe_sensor_time, -1), be_const_var(37) }, { be_const_key_weak(generate_random_passcode, 94), be_const_closure(class_Matter_Device_generate_random_passcode_closure) }, { be_const_key_weak(plugins_classes, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { - be_const_map( * be_nested_map(50, + be_const_map( * be_nested_map(52, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(relay, 29), be_const_class(be_class_Matter_Plugin_OnOff) }, - { be_const_key_weak(http_light3, -1), be_const_class(be_class_Matter_Plugin_Bridge_Light3) }, - { be_const_key_weak(v_light2, -1), be_const_class(be_class_Matter_Plugin_Virt_Light2) }, - { be_const_key_weak(illuminance, -1), be_const_class(be_class_Matter_Plugin_Sensor_Illuminance) }, - { be_const_key_weak(humidity, -1), be_const_class(be_class_Matter_Plugin_Sensor_Humidity) }, - { be_const_key_weak(http_occupancy, 31), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Occupancy) }, - { be_const_key_weak(http_contact, 14), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Contact) }, - { be_const_key_weak(light0, 16), be_const_class(be_class_Matter_Plugin_Light0) }, + { be_const_key_weak(v_rain, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Rain) }, + { be_const_key_weak(http_contact, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Contact) }, { be_const_key_weak(v_pressure, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Pressure) }, - { be_const_key_weak(v_light1, 10), be_const_class(be_class_Matter_Plugin_Virt_Light1) }, - { be_const_key_weak(http_airquality, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Air_Quality) }, - { be_const_key_weak(v_occupancy, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Occupancy) }, - { be_const_key_weak(http_flow, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Flow) }, - { be_const_key_weak(v_contact, 41), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Contact) }, + { be_const_key_weak(http_occupancy, 4), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Occupancy) }, + { be_const_key_weak(http_humidity, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Humidity) }, + { be_const_key_weak(flow, -1), be_const_class(be_class_Matter_Plugin_Sensor_Flow) }, + { be_const_key_weak(relay, 17), be_const_class(be_class_Matter_Plugin_OnOff) }, + { be_const_key_weak(v_light3, -1), be_const_class(be_class_Matter_Plugin_Virt_Light3) }, { be_const_key_weak(v_temp, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Temp) }, - { be_const_key_weak(http_illuminance, 33), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Illuminance) }, - { be_const_key_weak(rain, 22), be_const_class(be_class_Matter_Plugin_Sensor_Rain) }, + { be_const_key_weak(v_light1, -1), be_const_class(be_class_Matter_Plugin_Virt_Light1) }, + { be_const_key_weak(fan, -1), be_const_class(be_class_Matter_Plugin_Fan) }, { be_const_key_weak(v_relay, -1), be_const_class(be_class_Matter_Plugin_Virt_OnOff) }, - { be_const_key_weak(shutter, 6), be_const_class(be_class_Matter_Plugin_Shutter) }, - { be_const_key_weak(light2, -1), be_const_class(be_class_Matter_Plugin_Light2) }, + { be_const_key_weak(v_fan, -1), be_const_class(be_class_Matter_Plugin_Virt_Fan) }, + { be_const_key_weak(onoff, 2), be_const_class(be_class_Matter_Plugin_Sensor_OnOff) }, + { be_const_key_weak(http_waterleak, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Waterleak) }, + { be_const_key_weak(humidity, -1), be_const_class(be_class_Matter_Plugin_Sensor_Humidity) }, + { be_const_key_weak(http_light2, 49), be_const_class(be_class_Matter_Plugin_Bridge_Light2) }, + { be_const_key_weak(v_flow, 14), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Flow) }, { be_const_key_weak(http_light0, -1), be_const_class(be_class_Matter_Plugin_Bridge_Light0) }, - { be_const_key_weak(v_illuminance, 49), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Illuminance) }, - { be_const_key_weak(temperature, -1), be_const_class(be_class_Matter_Plugin_Sensor_Temp) }, - { be_const_key_weak(root, 27), be_const_class(be_class_Matter_Plugin_Root) }, - { be_const_key_weak(v_waterleak, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Waterleak) }, - { be_const_key_weak(contact, -1), be_const_class(be_class_Matter_Plugin_Sensor_Contact) }, + { be_const_key_weak(waterleak, -1), be_const_class(be_class_Matter_Plugin_Sensor_Waterleak) }, + { be_const_key_weak(rain, -1), be_const_class(be_class_Matter_Plugin_Sensor_Rain) }, + { be_const_key_weak(v_waterleak, 41), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Waterleak) }, { be_const_key_weak(http_rain, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Rain) }, - { be_const_key_weak(http_relay, -1), be_const_class(be_class_Matter_Plugin_Bridge_OnOff) }, - { be_const_key_weak(aggregator, -1), be_const_class(be_class_Matter_Plugin_Aggregator) }, - { be_const_key_weak(pressure, 43), be_const_class(be_class_Matter_Plugin_Sensor_Pressure) }, - { be_const_key_weak(shutter_X2Btilt, 24), be_const_class(be_class_Matter_Plugin_ShutterTilt) }, - { be_const_key_weak(v_humidity, 46), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Humidity) }, - { be_const_key_weak(http_light2, -1), be_const_class(be_class_Matter_Plugin_Bridge_Light2) }, - { be_const_key_weak(http_humidity, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Humidity) }, - { be_const_key_weak(light3, -1), be_const_class(be_class_Matter_Plugin_Light3) }, - { be_const_key_weak(v_airquality, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Air_Quality) }, - { be_const_key_weak(http_waterleak, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Waterleak) }, - { be_const_key_weak(waterleak, 8), be_const_class(be_class_Matter_Plugin_Sensor_Waterleak) }, - { be_const_key_weak(light1, 3), be_const_class(be_class_Matter_Plugin_Light1) }, - { be_const_key_weak(http_light1, -1), be_const_class(be_class_Matter_Plugin_Bridge_Light1) }, - { be_const_key_weak(v_flow, 13), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Flow) }, - { be_const_key_weak(v_light0, -1), be_const_class(be_class_Matter_Plugin_Virt_Light0) }, - { be_const_key_weak(occupancy, 48), be_const_class(be_class_Matter_Plugin_Sensor_Occupancy) }, - { be_const_key_weak(airquality, 34), be_const_class(be_class_Matter_Plugin_Sensor_Air_Quality) }, - { be_const_key_weak(http_temperature, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Temp) }, + { be_const_key_weak(light2, -1), be_const_class(be_class_Matter_Plugin_Light2) }, + { be_const_key_weak(shutter_X2Btilt, -1), be_const_class(be_class_Matter_Plugin_ShutterTilt) }, + { be_const_key_weak(light0, -1), be_const_class(be_class_Matter_Plugin_Light0) }, + { be_const_key_weak(pressure, -1), be_const_class(be_class_Matter_Plugin_Sensor_Pressure) }, + { be_const_key_weak(v_illuminance, 12), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Illuminance) }, + { be_const_key_weak(temperature, -1), be_const_class(be_class_Matter_Plugin_Sensor_Temp) }, { be_const_key_weak(http_pressure, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Pressure) }, - { be_const_key_weak(flow, -1), be_const_class(be_class_Matter_Plugin_Sensor_Flow) }, - { be_const_key_weak(onoff, -1), be_const_class(be_class_Matter_Plugin_Sensor_OnOff) }, - { be_const_key_weak(v_rain, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Rain) }, - { be_const_key_weak(v_light3, -1), be_const_class(be_class_Matter_Plugin_Virt_Light3) }, + { be_const_key_weak(occupancy, -1), be_const_class(be_class_Matter_Plugin_Sensor_Occupancy) }, + { be_const_key_weak(v_humidity, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Humidity) }, + { be_const_key_weak(v_light2, -1), be_const_class(be_class_Matter_Plugin_Virt_Light2) }, + { be_const_key_weak(v_occupancy, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Occupancy) }, + { be_const_key_weak(v_light0, 1), be_const_class(be_class_Matter_Plugin_Virt_Light0) }, + { be_const_key_weak(http_relay, 20), be_const_class(be_class_Matter_Plugin_Bridge_OnOff) }, + { be_const_key_weak(http_temperature, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Temp) }, + { be_const_key_weak(root, 28), be_const_class(be_class_Matter_Plugin_Root) }, + { be_const_key_weak(illuminance, -1), be_const_class(be_class_Matter_Plugin_Sensor_Illuminance) }, + { be_const_key_weak(v_airquality, 33), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Air_Quality) }, + { be_const_key_weak(aggregator, 22), be_const_class(be_class_Matter_Plugin_Aggregator) }, + { be_const_key_weak(v_contact, -1), be_const_class(be_class_Matter_Plugin_Virt_Sensor_Contact) }, + { be_const_key_weak(http_flow, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Flow) }, + { be_const_key_weak(http_light3, 44), be_const_class(be_class_Matter_Plugin_Bridge_Light3) }, + { be_const_key_weak(http_airquality, -1), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Air_Quality) }, + { be_const_key_weak(http_light1, -1), be_const_class(be_class_Matter_Plugin_Bridge_Light1) }, + { be_const_key_weak(shutter, 21), be_const_class(be_class_Matter_Plugin_Shutter) }, + { be_const_key_weak(contact, -1), be_const_class(be_class_Matter_Plugin_Sensor_Contact) }, + { be_const_key_weak(light3, 15), be_const_class(be_class_Matter_Plugin_Light3) }, + { be_const_key_weak(airquality, 0), be_const_class(be_class_Matter_Plugin_Sensor_Air_Quality) }, + { be_const_key_weak(light1, -1), be_const_class(be_class_Matter_Plugin_Light1) }, + { be_const_key_weak(http_illuminance, 31), be_const_class(be_class_Matter_Plugin_Bridge_Sensor_Illuminance) }, })) ) } )) }, { be_const_key_weak(start_operational_discovery, -1), be_const_closure(class_Matter_Device_start_operational_discovery_closure) }, { be_const_key_weak(tick, -1), be_const_var(10) },