Matter redesigned UI (#18855)

This commit is contained in:
s-hadinger 2023-06-11 19:10:12 +02:00 committed by GitHub
parent 5da84c52ff
commit a014f5495b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
44 changed files with 9117 additions and 7406 deletions

View File

@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
### Added
- Matter ability to add or remove endpoint in bridge mode (code only)
- Matter add controller's Vendor Name to logs and UI
- Matter redesigned UI
### Breaking Changed

View File

@ -62,7 +62,7 @@ class Matter_Device
var root_discriminator # as `int`
var root_passcode # as `int`
var ipv4only # advertize only IPv4 addresses (no IPv6)
var next_ep # next endpoint to be allocated for bridge, start at 51
var next_ep # next endpoint to be allocated for bridge, start at 1
# context for PBKDF
var root_iterations # PBKDF number of iterations
# PBKDF information used only during PASE (freed afterwards)
@ -88,7 +88,7 @@ class Matter_Device
self.vendorid = self.VENDOR_ID
self.productid = self.PRODUCT_ID
self.root_iterations = self.PBKDF_ITERATIONS
self.next_ep = 51 # start at endpoint 51 for dynamically allocated endpoints
self.next_ep = 1 # start at endpoint 1 for dynamically allocated endpoints
self.root_salt = crypto.random(16)
self.ipv4only = false
self.load_param()
@ -605,6 +605,20 @@ class Matter_Device
return ret
end
#############################################################
# Find plugin by endpoint
def find_plugin_by_endpoint(ep)
var idx = 0
while idx < size(self.plugins)
var pl = self.plugins[idx]
if pl.get_endpoint() == ep
return pl
end
idx += 1
end
return nil
end
#############################################################
# Persistance of Matter Device parameters
#
@ -1090,13 +1104,30 @@ class Matter_Device
# auto-detect sensors
var sensors = json.load(tasmota.read_sensors())
var sensors_list = self.autoconf_sensors_list(sensors)
for s: sensors_list
m[str(endpoint)] = s
endpoint += 1
end
# tasmota.publish_result('{"Matter":{"Initialized":1}}', 'Matter') # MQTT is not yet connected
return m
end
#############################################################
# Autoconfigure from sensors
#
# Returns an ordered list
def autoconf_sensors_list(sensors)
var ret = []
# temperature sensors
for k1:self.k2l(sensors)
var sensor_2 = sensors[k1]
if isinstance(sensor_2, map) && sensor_2.contains("Temperature")
var temp_rule = k1 + "#Temperature"
m[str(endpoint)] = {'type':'temperature','filter':temp_rule}
endpoint += 1
ret.push({'type':'temperature','filter':temp_rule})
end
end
@ -1105,8 +1136,7 @@ class Matter_Device
var sensor_2 = sensors[k1]
if isinstance(sensor_2, map) && sensor_2.contains("Pressure")
var temp_rule = k1 + "#Pressure"
m[str(endpoint)] = {'type':'pressure','filter':temp_rule}
endpoint += 1
ret.push({'type':'pressure','filter':temp_rule})
end
end
@ -1115,8 +1145,7 @@ class Matter_Device
var sensor_2 = sensors[k1]
if isinstance(sensor_2, map) && sensor_2.contains("Illuminance")
var temp_rule = k1 + "#Illuminance"
m[str(endpoint)] = {'type':'illuminance','filter':temp_rule}
endpoint += 1
ret.push({'type':'illuminance','filter':temp_rule})
end
end
@ -1125,12 +1154,11 @@ class Matter_Device
var sensor_2 = sensors[k1]
if isinstance(sensor_2, map) && sensor_2.contains("Humidity")
var temp_rule = k1 + "#Humidity"
m[str(endpoint)] = {'type':'humidity','filter':temp_rule}
endpoint += 1
ret.push({'type':'humidity','filter':temp_rule})
end
end
# tasmota.publish_result('{"Matter":{"Initialized":1}}', 'Matter') # MQTT is not yet connected
return m
return ret
end
# get keys of a map in sorted order
@ -1262,6 +1290,8 @@ class Matter_Device
idx += 1
end
end
# clean any orphan remote
self.clean_remotes()
end
#############################################################
@ -1337,6 +1367,51 @@ class Matter_Device
return http_remote
end
#####################################################################
# Remove HTTP remotes that are no longer referenced
def clean_remotes()
import introspect
import string
var remotes_map = {} # key: remote object, value: count of references
# init all remotes with count 0
for http_remote: self.http_remotes
remotes_map[http_remote] = 0
end
# scan all endpoints
for pi: self.plugins
var http_remote = introspect.get(pi, "http_remote")
if http_remote != nil
remotes_map[http_remote] = remotes_map.find(http_remote, 0) + 1
end
end
tasmota.log("MTR: remotes references: " + str(remotes_map))
for remote:remotes_map.keys()
if remotes_map[remote] == 0
# remove
tasmota.log("MTR: remove unused remote: " + remote.addr, 3)
remote.close()
self.http_remotes.remove(remote)
end
end
end
# def get_remotes_list()
#####################################################################
# Get sorted list of remote endpoints
# def get_remotes_list()
# var ret = []
# for hr: self.http_remotes
# ret.push(hr.addr)
# end
# return self.sort_distinct(ret)
# end
#####################################################################
# Commands `Mtr___`
#####################################################################

View File

@ -55,10 +55,28 @@ class Matter_Plugin
# device: contains the root device object so the plugin can "call home"
# endpoint: (int) the endpoint number (16 bits)
# arguments: (map) the map for all complementary arguments that are plugin specific
def init(device, endpoint, arguments)
def init(device, endpoint, config)
self.device = device
self.endpoint = endpoint
self.clusters = self.consolidate_clusters()
self.parse_configuration(config)
end
#############################################################
# parse_configuration
#
# Parse configuration map
# TO BE OVERRIDEN
def parse_configuration(config)
end
#############################################################
# is_local_device
#
# Returns true if it's a local device, or false for a
# remotely device controlled via HTTP
def is_local_device()
return true
end
#############################################################

View File

@ -60,6 +60,15 @@ class Matter_Plugin_Bridge_HTTP : Matter_Plugin_Device
self.register_cmd_cb()
end
#############################################################
# is_local_device
#
# Returns true if it's a local device, or false for a
# remotely device controlled via HTTP
def is_local_device()
return false
end
#############################################################
# register_cmd_cb
#
@ -196,34 +205,6 @@ class Matter_Plugin_Bridge_HTTP : Matter_Plugin_Device
# avoid calling update_shadow() since it's not applicable for HTTP remote
end
#############################################################
# UI Methods
#############################################################
# ui_conf_to_string
#
# Convert the current plugin parameters to a single string
static def ui_conf_to_string(cl, conf)
var s = super(_class).ui_conf_to_string(cl, conf)
var url = str(conf.find(_class.ARG_HTTP, ''))
var arg = s + "," + url
# print("MTR: ui_conf_to_string", conf, cl, arg)
return arg
end
#############################################################
# ui_string_to_conf
#
# Convert the string in UI to actual parameters added to the map
static def ui_string_to_conf(cl, conf, arg)
import string
var elts = string.split(arg + ',', ',', 3) # add ',' at the end to be sure to have at least 2 arguments
conf[_class.ARG_HTTP] = elts[1]
super(_class).ui_string_to_conf(cl, conf, elts[0])
# print("ui_string_to_conf", conf, arg)
return conf
end
#############################################################
# web_values
#

View File

@ -28,7 +28,7 @@ class Matter_Plugin_Bridge_HTTP end
class Matter_Plugin_Bridge_Light0 : Matter_Plugin_Bridge_HTTP
static var TYPE = "http_light0" # name of the plug-in in json
static var NAME = "&#x1F517; Light 0 On" # display name of the plug-in
static var NAME = "Light 0 On" # display name of the plug-in
static var ARG = "relay" # additional argument name (or empty if none)
static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
# static var UPDATE_TIME = 3000 # update every 3s

View File

@ -28,7 +28,7 @@ class Matter_Plugin_Bridge_Light0 end
class Matter_Plugin_Bridge_Light1 : Matter_Plugin_Bridge_Light0
static var TYPE = "http_light1" # name of the plug-in in json
static var NAME = "&#x1F517; Light 1 Dimmer" # display name of the plug-in
static var NAME = "Light 1 Dimmer" # display name of the plug-in
# static var ARG = "relay" # additional argument name (or empty if none)
# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
static var CLUSTERS = {

View File

@ -28,7 +28,7 @@ class Matter_Plugin_Bridge_Light1 end
class Matter_Plugin_Bridge_Light2 : Matter_Plugin_Bridge_Light1
static var TYPE = "http_light2" # name of the plug-in in json
static var NAME = "&#x1F517; Light 2 CT" # display name of the plug-in
static var NAME = "Light 2 CT" # display name of the plug-in
# static var ARG = "relay" # additional argument name (or empty if none)
# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
static var CLUSTERS = {

View File

@ -28,7 +28,7 @@ class Matter_Plugin_Bridge_Light1 end
class Matter_Plugin_Bridge_Light3 : Matter_Plugin_Bridge_Light1
static var TYPE = "http_light3" # name of the plug-in in json
static var NAME = "&#x1F517; Light 3 RGB" # display name of the plug-in
static var NAME = "Light 3 RGB" # display name of the plug-in
# static var ARG = "relay" # additional argument name (or empty if none)
# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
static var CLUSTERS = {

View File

@ -28,7 +28,7 @@ class Matter_Plugin_Bridge_Light0 end
class Matter_Plugin_Bridge_OnOff : Matter_Plugin_Bridge_Light0
static var TYPE = "http_relay" # name of the plug-in in json
static var NAME = "&#x1F517; Relay" # display name of the plug-in
static var NAME = "Relay" # display name of the plug-in
static var TYPES = { 0x010A: 2 } # On/Off Plug-in Unit
#############################################################

View File

@ -40,10 +40,11 @@ class Matter_Plugin_Bridge_Sensor : Matter_Plugin_Bridge_HTTP
var shadow_value # Last known value
#############################################################
# Constructor
def init(device, endpoint, arguments)
super(self).init(device, endpoint, arguments)
self.tasmota_sensor_filter = arguments.find(self.ARG#-'filter'-#)
# parse_configuration
#
# Parse configuration map
def parse_configuration(config)
self.tasmota_sensor_filter = config.find(self.ARG#-'filter'-#)
if self.tasmota_sensor_filter
self.tasmota_sensor_matcher = tasmota.Rule_Matcher.parse(self.tasmota_sensor_filter)
end

View File

@ -28,7 +28,7 @@ class Matter_Plugin_Bridge_Sensor end
class Matter_Plugin_Bridge_Sensor_Humidity : Matter_Plugin_Bridge_Sensor
static var TYPE = "http_humidity" # name of the plug-in in json
static var NAME = "&#x1F517; Humidity" # display name of the plug-in
static var NAME = "Humidity" # display name of the plug-in
static var CLUSTERS = {
0x0405: [0,1,2,0xFFFC,0xFFFD], # Humidity Measurement p.102 - no writable

View File

@ -28,7 +28,7 @@ class Matter_Plugin_Bridge_Sensor end
class Matter_Plugin_Bridge_Sensor_Illuminance : Matter_Plugin_Bridge_Sensor
static var TYPE = "http_illuminance" # name of the plug-in in json
static var NAME = "&#x1F517; Illuminance" # display name of the plug-in
static var NAME = "Illuminance" # display name of the plug-in
static var CLUSTERS = {
0x0400: [0,1,2,0xFFFC,0xFFFD], # Illuminance Measurement p.95 - no writable

View File

@ -28,7 +28,7 @@ class Matter_Plugin_Bridge_HTTP end
class Matter_Plugin_Bridge_Sensor_Occupancy : Matter_Plugin_Bridge_HTTP
static var TYPE = "http_occupancy" # name of the plug-in in json
static var NAME = "&#x1F517; Occupancy" # display name of the plug-in
static var NAME = "Occupancy" # display name of the plug-in
static var ARG = "switch" # additional argument name (or empty if none)
static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
static var UPDATE_TIME = 5000 # update every 5s

View File

@ -28,7 +28,7 @@ class Matter_Plugin_Bridge_Sensor end
class Matter_Plugin_Bridge_Sensor_Pressure : Matter_Plugin_Bridge_Sensor
static var TYPE = "http_pressure" # name of the plug-in in json
static var NAME = "&#x1F517; Pressure" # display name of the plug-in
static var NAME = "Pressure" # display name of the plug-in
static var CLUSTERS = {
0x0403: [0,1,2,0xFFFC,0xFFFD], # Pressure Measurement

View File

@ -28,7 +28,7 @@ class Matter_Plugin_Bridge_Sensor end
class Matter_Plugin_Bridge_Sensor_Temp : Matter_Plugin_Bridge_Sensor
static var TYPE = "http_temperature" # name of the plug-in in json
static var NAME = "&#x1F517; Temperature" # display name of the plug-in
static var NAME = "Temperature" # display name of the plug-in
static var CLUSTERS = {
0x0402: [0,1,2,0xFFFC,0xFFFD], # Temperature Measurement p.97 - no writable

View File

@ -43,8 +43,8 @@ class Matter_Plugin_Light0 : Matter_Plugin_Device
#############################################################
# Constructor
def init(device, endpoint, arguments)
super(self).init(device, endpoint, arguments)
def init(device, endpoint, config)
super(self).init(device, endpoint, config)
self.shadow_onoff = false
end

View File

@ -46,10 +46,17 @@ class Matter_Plugin_OnOff : Matter_Plugin_Device
#############################################################
# Constructor
def init(device, endpoint, arguments)
super(self).init(device, endpoint, arguments)
def init(device, endpoint, config)
super(self).init(device, endpoint, config)
self.shadow_onoff = false
self.tasmota_relay_index = int(arguments.find(self.ARG #-'relay'-#, 1))
end
#############################################################
# parse_configuration
#
# Parse configuration map
def parse_configuration(config)
self.tasmota_relay_index = int(config.find(self.ARG #-'relay'-#, 1))
if self.tasmota_relay_index <= 0 self.tasmota_relay_index = 1 end
end

View File

@ -50,9 +50,9 @@ class Matter_Plugin_Root : Matter_Plugin
#############################################################
# Constructor
def init(device, endpoint, arguments)
super(self).init(device, endpoint, arguments)
end
# def init(device, endpoint, config)
# super(self).init(device, endpoint, config)
# end
#############################################################
# read an attribute

View File

@ -34,10 +34,11 @@ class Matter_Plugin_Sensor : Matter_Plugin_Device
var shadow_value # Last known value
#############################################################
# Constructor
def init(device, endpoint, arguments)
super(self).init(device, endpoint, arguments)
self.tasmota_sensor_filter = arguments.find(self.ARG#-'filter'-#)
# parse_configuration
#
# Parse configuration map
def parse_configuration(config)
self.tasmota_sensor_filter = config.find(self.ARG#-'filter'-#)
if self.tasmota_sensor_filter
self.tasmota_sensor_matcher = tasmota.Rule_Matcher.parse(self.tasmota_sensor_filter)
end

View File

@ -41,10 +41,11 @@ class Matter_Plugin_Sensor_Occupancy : Matter_Plugin_Device
var shadow_occupancy
#############################################################
# Constructor
def init(device, endpoint, arguments)
super(self).init(device, endpoint, arguments)
self.tasmota_switch_index = int(arguments.find(self.ARG #-'relay'-#, 1))
# parse_configuration
#
# Parse configuration map
def parse_configuration(config)
self.tasmota_switch_index = int(config.find(self.ARG #-'relay'-#, 1))
if self.tasmota_switch_index <= 0 self.tasmota_switch_index = 1 end
end

View File

@ -39,10 +39,11 @@ class Matter_Plugin_Sensor_OnOff : Matter_Plugin_Device
var shadow_onoff
#############################################################
# Constructor
def init(device, endpoint, arguments)
super(self).init(device, endpoint, arguments)
self.tasmota_switch_index = int(arguments.find(self.ARG #-'relay'-#, 1))
# parse_configuration
#
# Parse configuration map
def parse_configuration(config)
self.tasmota_switch_index = int(config.find(self.ARG #-'relay'-#, 1))
if self.tasmota_switch_index <= 0 self.tasmota_switch_index = 1 end
end

View File

@ -48,10 +48,11 @@ class Matter_Plugin_Shutter : Matter_Plugin_Device
var shadow_shutter_inverted # 1=same as matter 0=matter must invert
#############################################################
# Constructor
def init(device, endpoint, arguments)
super(self).init(device, endpoint, arguments)
self.tasmota_shutter_index = arguments.find(self.ARG #-'relay'-#)
# parse_configuration
#
# Parse configuration map
def parse_configuration(config)
self.tasmota_shutter_index = config.find(self.ARG #-'relay'-#)
if self.tasmota_shutter_index == nil self.tasmota_shutter_index = 0 end
self.shadow_shutter_inverted = -1
end

View File

@ -34,11 +34,30 @@ import matter
class Matter_UI
static var _CLASSES_TYPES = "|relay|light0|light1|light2|light3|shutter|shutter+tilt"
"|temperature|pressure|illuminance|humidity|occupancy|onoff"
static var _CLASSES_TYPES2= "-http|http_relay|http_light0|http_light1|http_light2|http_light3"
# static var _CLASSES_HTTP = "-http"
static var _CLASSES_TYPES2= "|http_relay|http_light0|http_light1|http_light2|http_light3"
"|http_temperature|http_pressure|http_illuminance|http_humidity"
"|http_occupancy"
var device
# ####################################################################################################
# Static function to compare two maps (shallow compare)
# return true if equal
static def equal_map(a, b)
# all items of a are in b
for k: a.keys()
if !b.contains(k) return false end
if b[k] != a[k] return false end
end
for k: b.keys()
if !a.contains(k) return false end
if b[k] != a[k] return false end
end
return true
end
# ####################################################################################################
# Constructor
def init(device)
self.device = device
tasmota.add_driver(self)
@ -56,29 +75,39 @@ class Matter_UI
webserver.content_send(" Configure Matter</button></form></p>")
end
#- ---------------------------------------------------------------------- -#
#- Is Matter enabled?
#- ---------------------------------------------------------------------- -#
def matter_enabled()
return bool(tasmota.get_option(matter.MATTER_OPTION))
end
#- ---------------------------------------------------------------------- -#
#- Show commissioning information and QR Code
#
# Returns true if Matter is enabled
#- ---------------------------------------------------------------------- -#
def show_enable(p)
def show_enable()
import webserver
import string
var matter_enabled = tasmota.get_option(matter.MATTER_OPTION)
var matter_enabled = self.matter_enabled
webserver.content_send(string.format("<fieldset><legend><b>&nbsp;Matter %s&nbsp;</b></legend><p></p>",
matter_enabled ? "Enabled" : "Disabled"))
webserver.content_send("<fieldset><legend><b>&nbsp;Matter &nbsp;</b></legend><p></p>"
"<p style='width:320px;'>Check the <a href='https://tasmota.github.io/docs/Matter/' target='_blank'>Matter documentation</a>.</p>"
"<form action='/matterc' method='post'>")
webserver.content_send("<p style='width:320px;'>Check the <a href='https://tasmota.github.io/docs/Matter/' target='_blank'>Matter documentation</a>.</p>")
# checkbox for Matter enable
webserver.content_send(string.format("<p><input id='menable' type='checkbox' name='menable' %s>", self.matter_enabled() ? "checked" : ""))
webserver.content_send("<label for='menable'><b>Matter enable</b></label></p>")
webserver.content_send("<form action='/matterc' method='post' onsubmit='return confirm(\"This will cause a restart.\");'>")
webserver.content_send(string.format("<p></p><button name='%s' class='button bgrn'>", matter_enabled ? "disable" : "enable"))
webserver.content_send(matter_enabled ? "Disable" : "Enable")
webserver.content_send(" Matter</button></form></p>")
if self.matter_enabled()
# checkbox for Matter commissioning
webserver.content_send(string.format("<p><input id='comm' type='checkbox' name='comm' %s>", self.device.commissioning_open != nil ? "checked" : ""))
webserver.content_send("<label for='comm'><b>Commissioning open</b></label></p>")
end
webserver.content_send("<p></p></fieldset><p></p>")
return matter_enabled
webserver.content_send("<p></p><button name='save' class='button bgrn'>Save</button></form></p>"
"<p></p></fieldset><p></p>")
end
#- ---------------------------------------------------------------------- -#
@ -145,13 +174,11 @@ class Matter_UI
var pairing_code = self.device.compute_manual_pairing_code()
webserver.content_send(string.format("<p>Manual pairing code:<br><b>%s-%s-%s</b></p><hr>", pairing_code[0..3], pairing_code[4..6], pairing_code[7..]))
webserver.content_send(string.format("<div><center>"))
webserver.content_send("<div><center>")
var qr_text = self.device.compute_qrcode_content()
self.show_qrcode(qr_text)
webserver.content_send(string.format("<p> %s</p>", qr_text))
webserver.content_send(string.format("</div>"))
webserver.content_send("<p></p></fieldset><p></p>")
webserver.content_send("</div><p></p></fieldset><p></p>")
end
@ -162,24 +189,16 @@ class Matter_UI
import webserver
import string
webserver.content_send("<fieldset><legend><b>&nbsp;Matter Passcode&nbsp;</b></legend><p></p>")
# button for open/close commissioning
webserver.content_send("<form action='/matterc' method='post'>")
if self.device.commissioning_open == nil
webserver.content_send(string.format("<p></p><button name='open_comm' class='button bgrn'>%s</button>", "Open Commissioning"))
else
webserver.content_send(string.format("<p></p><button name='clos_comm' class='button bgrn'>%s</button>", "Close Commissioning"))
end
webserver.content_send("</form></p>")
webserver.content_send("<fieldset><legend><b>&nbsp;Matter Advanced Configuration&nbsp;</b></legend><p></p>")
#
webserver.content_send("<form action='/matterc' method='post' onsubmit='return confirm(\"This will cause a restart.\");'>")
webserver.content_send("<p>Passcode:</p>")
webserver.content_send("<form action='/matterc' method='post' onsubmit='return confirm(\"This will cause a restart.\");'>"
"<p>Passcode:</p>")
webserver.content_send(string.format("<input type='number' min='1' max='99999998' name='passcode' value='%i'>", self.device.root_passcode))
webserver.content_send("<p>Distinguish id:</p>")
webserver.content_send(string.format("<input type='number' min='0' max='4095' name='discriminator' value='%i'>", self.device.root_discriminator))
webserver.content_send(string.format("<p><input type='checkbox' name='ipv4'%s>IPv4 only</p>", self.device.ipv4only ? " checked" : ""))
webserver.content_send("<p></p><button name='passcode' class='button bgrn'>Change</button></form></p>")
webserver.content_send("<p></p></fieldset><p></p>")
webserver.content_send("<p></p><button name='passcode' class='button bgrn'>Change</button></form></p>"
"<p></p></fieldset><p></p>")
end
@ -190,8 +209,8 @@ class Matter_UI
import webserver
import string
webserver.content_send("<fieldset><legend><b>&nbsp;Fabrics&nbsp;</b></legend><p></p>")
webserver.content_send("<p>Associated fabrics:</p>")
webserver.content_send("<fieldset><legend><b>&nbsp;Fabrics&nbsp;</b></legend><p></p>"
"<p>Associated fabrics:</p>")
if size(self.device.sessions.sessions) == 0
webserver.content_send("<p><b>None</b></p>")
@ -230,68 +249,176 @@ class Matter_UI
def show_plugins_configuration()
import webserver
import string
import introspect
webserver.content_send("<fieldset><legend><b>&nbsp;Current Configuration&nbsp;</b></legend><p></p>")
webserver.content_send("<form action='/matterc' method='post'")
webserver.content_send("onsubmit='return confirm(\"This will RESET the configuration to the default. You will need to associate again.\");'>")
webserver.content_send("<button name='auto' class='button bred'>Reset and Auto-discover</button><p></p></form>")
# webserver.content_send("<p></p><form style='display: block;' action='matteradd' method='get'><button class='button bgrn' name=''>Create new endpoint</button></form>")
# webserver.content_send("<div style='display: block;'></div><hr>")
webserver.content_send("<form action='/matterc' method='post'")
webserver.content_send("onsubmit='return confirm(\"Changing the configuration requires to associate again.\");'>")
webserver.content_send("<table style='width:100%'>")
webserver.content_send("<tr><td width='35'><b>Ep.</b></td><td><b>Type</b></td><td><b>Param</b></td></tr>")
webserver.content_send("<form action='/matterc' method='post'"
"<p><b>Local sensors and devices</b></p>"
"<table style='width:100%'>"
"<tr><td width='25'>#</td><td width='115'>Type</td><td>Parameter</td><td width='15'></td></tr>")
# display one line per plug-in
self.device.plugins_config.remove("0") # remove any leftover from ancient configuration
var endpoints = self.device.k2l_num(self.device.plugins_config)
var i = 0
var found = false
# special case for root node
# display a fake configuration item (disabled)
webserver.content_send("<tr><td><input type='text' name='epnone' maxlength='4' size='3' value='0' readonly disabled></td>")
webserver.content_send("<td><select name='pinone'>")
webserver.content_send("<option value='' selected disabled>Root node</option>")
webserver.content_send("</select></td>")
webserver.content_send("<td><font size='-1'>&nbsp;</font></td>")
while i < size(endpoints)
var ep = endpoints[i]
if ep == 0 i += 1 continue end # skip endpoint 0 (leftover from previous versions)
var conf = self.device.plugins_config[str(ep)]
var conf = self.device.plugins_config.find(str(ep))
var typ = conf.find('type')
if !typ i += 1 continue end
# skip any remote class
if string.find(typ, "http_") == 0 i += 1 continue end
var cl = self.device.plugins_classes.find(typ)
var arg = ""
if cl != nil
arg = cl.ui_conf_to_string(cl, conf)
end
# var arg_name = self.device.get_plugin_class_arg(typ)
# var arg = arg_name ? str(conf.find(arg_name, '')) : ''
webserver.content_send(string.format("<tr><td><input type='text' name='ep%03i' maxlength='4' size='3' pattern='[0-9]{1,4}' value='%i'></td>", i, ep))
found = true
webserver.content_send(string.format("<tr><td><font size='-1'><b>%i</b></font></td>", ep))
webserver.content_send(string.format("<td><select name='pi%03i'>", i))
self.plugin_option(conf.find('type', ''), self._CLASSES_TYPES, self._CLASSES_TYPES2)
webserver.content_send(string.format("</select></td>"))
webserver.content_send(string.format("<td><font size='-1'><input type='text' name='arg%03i' minlength='0' size='8' value='%s'></font></td>",
i, webserver.html_escape(arg)))
webserver.content_send(string.format("<td><font size='-1'><b>%s</b></font></td>", self.plugin_name(conf.find('type', ''))))
webserver.content_send(string.format("<td><font size='-1'><input type='text' name='arg%i' minlength='0' size='8' value='%s'></font></td>",
ep, webserver.html_escape(arg)))
webserver.content_send(string.format("<td style='text-align:center;'><button name='del%i' "
"style='background:none;border:none;line-height:1;'"
" onclick=\"return confirm('Confirm removing endpoint')\""
">"
"&#128293;</button></td></tr>", ep))
i += 1
end
webserver.content_send("</table>")
# if array is empty, still display <none>
if !found
webserver.content_send("<p>&lt;none&gt;</p>")
end
# add an empty line for adding a configuration
webserver.content_send(string.format("<tr><td><input type='text' name='ep%03i' maxlength='4' size='3' pattern='[0-9]{1,4}' value=''></td>", i))
webserver.content_send(string.format("<td><select name='pi%03i'>", i))
self.plugin_option('', self._CLASSES_TYPES, self._CLASSES_TYPES2)
webserver.content_send(string.format("</select></td>"))
webserver.content_send(string.format("<td><font size='-1'><input type='text' name='arg%03i' minlength='0' size='8' value=''></font></td>", i))
# webserver.content_send(string.format("<tr><td><input type='text' name='ep%03i' maxlength='4' size='3' pattern='[0-9]{1,4}' value=''></td>", i))
# webserver.content_send(string.format("<td><select name='pi%03i'>", i))
# self.plugin_option('', self._CLASSES_TYPES, self._CLASSES_TYPES2)
# webserver.content_send(string.format("</select></td>"))
# webserver.content_send(string.format("<td><font size='-1'><input type='text' name='arg%03i' minlength='0' size='8' value=''></font></td></td></td></tr>", i))
webserver.content_send("</table><p></p>")
webserver.content_send("<button name='config' class='button bgrn'>Change configuration</button></form>")
webserver.content_send("<p></p></fieldset><p></p>")
# remote devices
webserver.content_send("<p></p>")
# iterate on each remote device
var remotes = []
for conf: self.device.plugins_config
var url = conf.find("url")
if url != nil
remotes.push(url)
end
end
self.device.sort_distinct(remotes)
tasmota.log("MTR: remotes: "+str(remotes), 3)
for remote: remotes
webserver.content_send(string.format("&#x1F517; <a target='_blank' href=\"http://%s/\">%s</a>", webserver.html_escape(remote), webserver.html_escape(remote)))
webserver.content_send("<table style='width:100%'>")
webserver.content_send("<tr><td width='25'></td><td width='115'></td><td></td><td width='15'></td></tr>")
found = false
i = 0
while i < size(endpoints)
var ep = endpoints[i]
var conf = self.device.plugins_config.find(str(ep))
var typ = conf.find('type')
if !typ i += 1 continue end
# skip any non-remote class
if string.find(typ, "http_") != 0 i += 1 continue end
# check if it's the right remote
if conf.find("url") != remote i += 1 continue end
var cl = self.device.plugins_classes.find(typ)
var arg = ""
if cl != nil
arg = cl.ui_conf_to_string(cl, conf)
end
found = true
webserver.content_send(string.format("<tr><td width='22'><font size='-1'><b>%i</b></font></td>", ep))
webserver.content_send(string.format("<td width='115'><font size='-1'><b>%s</b></select></font></td>", self.plugin_name(conf.find('type', ''))))
webserver.content_send(string.format("<td><font size='-1'><input type='text' name='arg%i' minlength='0' size='8' value='%s'></font></td>",
ep, webserver.html_escape(arg)))
webserver.content_send(string.format("<td width='15' style='text-align:center;'><button name='del%i' "
"style='background:none;border:none;line-height:1;'"
" onclick=\"return confirm('Confirm removing endpoint')\""
">"
"&#128293;</button></td></tr>", ep))
i += 1
end
webserver.content_send("</table><p></p>")
end # for remote: self.device.get_remotes_list()
if !found
webserver.content_send("<p>&lt;none&gt;</p>")
end
webserver.content_send("<button name='config' class='button bgrn'>"
"Change configuration</button></form>")
# Add new endpoint section
webserver.content_send("<hr><p><b>Add local sensor or device</b></p>"
"<form action='/matterc' method='post'>"
"<table style='width:100%'>"
"<tr><td width='145'>Type</td><td>Parameter</td></tr>")
webserver.content_send("<tr><td><font size='-1'><select name='pi'>")
self.plugin_option('', self._CLASSES_TYPES)
webserver.content_send("</select></font></td>")
webserver.content_send("<td><font size='-1'><input type='text' name='arg' minlength='0' size='8' value=''></font></td>"
"</tr></table>")
webserver.content_send("<div style='display: block;'></div>")
webserver.content_send("<button name='addep' class='button bgrn'"
">Create new endpoint</button></form>")
# Add remote endpoint
webserver.content_send("<hr><p><b>Add Remote Tasmota</b></p>"
"<form action='/matteradd' method='get'>"
"<table style='width:100%'>")
webserver.content_send("<tr><td width='30'><font size='-1'><b>http://</b></font></td><td><input type='text' name='url' minlength='0' size='8' value='' required placeholder='IP or domain'></td><td width='10'><font size='-1'><b>/</b></font></td></tr>"
"</tr></table>")
webserver.content_send("<div style='display: block;'></div>")
webserver.content_send("<button class='button bgrn'>"
"Auto-configure remote Tasmota</button></form><hr>")
# button "Reset and Auto-discover"
webserver.content_send("<form action='/matterc' method='post'"
"onsubmit='return confirm(\"This will RESET the configuration to the default. You will need to associate again.\");'>"
"<button name='auto' class='button bred'>Reset and Auto-discover</button><p></p></form>")
webserver.content_send("<p></p></fieldset>")
end
#- ---------------------------------------------------------------------- -#
#- Show pretty name for plugin class
#- ---------------------------------------------------------------------- -#
def plugin_name(cur, *class_list)
if cur == '' return '' end
return self.device.get_plugin_class_displayname(cur)
end
#- ---------------------------------------------------------------------- -#
@ -320,6 +447,28 @@ class Matter_UI
end
end
#######################################################################
# Display the advanced configuration page
#######################################################################
def page_part_mgr_adv()
import webserver
import string
if !webserver.check_privileged_access() return nil end
webserver.content_start("Matter Advanced Configuration") #- title of the web page -#
webserver.content_send_style() #- send standard Tasmota styles -#
if self.matter_enabled()
self.show_passcode_form()
self.show_fabric_info()
end
webserver.content_button(webserver.BUTTON_CONFIGURATION)
webserver.content_stop() #- end of web page -#
end
#######################################################################
# Display the complete page
#######################################################################
@ -332,17 +481,188 @@ class Matter_UI
webserver.content_start("Matter") #- title of the web page -#
webserver.content_send_style() #- send standard Tasmota styles -#
if self.show_enable()
self.show_passcode_form()
self.show_enable()
if self.matter_enabled()
self.show_plugins_configuration()
self.show_fabric_info()
end
webserver.content_send("<div style='display: block;'></div>")
webserver.content_send("<p></p><form id='butmat' style='display: block;' action='mattera' method='get'><button name=''>Advanced Configuration</button></form>")
webserver.content_button(webserver.BUTTON_CONFIGURATION)
webserver.content_stop() #- end of web page -#
end
#---------------------------------------------------------------------- -#
# Generate configuration map from Status 8 and Status 11
#
# Returns a list of maps: [ {"type":"temperature", "filter":"ESP32#Temperature"} ]
#---------------------------------------------------------------------- -#
def generate_config_from_status(status8, status11)
var config_list = []
# count `Power` and `Power<x>`
var power_cnt = 0
if status11.contains("POWER")
power_cnt = 1
else
var idx = 1
while true
if status11.contains("POWER" + str(idx))
power_cnt = idx
idx += 1
else
break
end
end
end
# Now `power_cnt` contains the number of Relays including light
# detect lights
var light1, light2, light3 # contains a relay number of nil
if status11.contains("HSBColor")
light3 = power_cnt
power_cnt -= 1
elif status11.contains("CT")
light2 = power_cnt
power_cnt -= 1
elif status11.contains("Dimmer")
light1 = power_cnt
power_cnt -= 1
end
# rest is relays
for i: 1..power_cnt
config_list.push({'type': 'light0', 'relay': i})
end
# show lights
if light1 != nil
config_list.push({'type': 'light1', 'relay': light1})
end
if light2 != nil
config_list.push({'type': 'light2', 'relay': light2})
end
if light3 != nil
config_list.push({'type': 'light3', 'relay': light3})
end
# detect sensors
config_list += self.device.autoconf_sensors_list(status8)
return config_list
end
#- ---------------------------------------------------------------------- -#
#- Probe remote device
#- ---------------------------------------------------------------------- -#
def show_remote_autoconf(url)
import webserver
import string
import json
if url == '' return end
var timeout = matter.Plugin_Bridge_HTTP.PROBE_TIMEOUT
var http_remote = matter.HTTP_remote(url, timeout)
# Status 8
var status8 = http_remote.call_sync('Status 8', timeout)
if status8 != nil status8 = json.load(status8) end
if status8 != nil status8 = status8.find('StatusSNS') end
# Status 11
var status11
if status8 != nil
status11 = http_remote.call_sync('Status 11', timeout)
if status11 != nil status11 = json.load(status11) end
if status11 != nil status11 = status11.find('StatusSTS') end
end
if status8 != nil && status11 != nil
tasmota.log(string.format("MTR: probed '%s' status8=%s satus11=%s", url, str(status8), str(status11)), 3)
var config_list = self.generate_config_from_status(status8, status11)
webserver.content_send("<fieldset><legend><b>&nbsp;Matter Remote Device&nbsp;</b></legend><p></p>"
"<p><b>Add Remote sensor or device</b></p>")
webserver.content_send(string.format("<p>&#x1F517; <a target='_blank' href=\"http://%s/\">%s</a></p>", webserver.html_escape(url), webserver.html_escape(url)))
# Add new endpoint section
webserver.content_send("<form action='/matterc' method='post'>"
"<table style='width:100%'>"
"<tr><td width='145'>Type</td><td>Parameter</td></tr>")
webserver.content_send(string.format("<input name='url' type='hidden' value='%s'>", webserver.html_escape(url)))
var i = 0
while i < size(config_list)
var config = config_list[i]
var typ = config.find('type', '')
if typ != '' typ = "http_" + typ end
var cl = self.device.plugins_classes.find(typ)
var arg = ""
if cl != nil
arg = cl.ui_conf_to_string(cl, config)
end
webserver.content_send(string.format("<tr><td><font size='-1'><select name='pi%i'>", i))
self.plugin_option(typ, self._CLASSES_TYPES2)
webserver.content_send("</select></font></td>"
"<td><font size='-1'>")
webserver.content_send(string.format("<input type='text' name='arg%i' minlength='0' size='8' value='%s'>",
i, webserver.html_escape(arg)))
webserver.content_send("</font></td></tr>")
i += 1
end
# empty line for new endpoint
webserver.content_send(string.format("<tr><td><font size='-1'><select name='pi%i'>", i))
self.plugin_option('', self._CLASSES_TYPES2)
webserver.content_send("</select></font></td>"
"<td><font size='-1'>")
webserver.content_send(string.format("<input type='text' name='arg%i' minlength='0' size='8' value='%s'>",
i, ''))
webserver.content_send("</font></td></tr>")
# end of table
webserver.content_send("</table>")
webserver.content_send("<div style='display: block;'></div>")
webserver.content_send("<button name='addrem' class='button bgrn'>"
"Add endpoints</button></form>")
webserver.content_send("</form></fieldset><p></p>")
else
webserver.content_send(string.format("<p><b>Unable to connect to '%s'</b></p>", webserver.html_escape(url)))
end
end
#######################################################################
# Display the page for adding a new endpoint
#######################################################################
def page_part_mgr_add()
import webserver
import string
if !webserver.check_privileged_access() return nil end
webserver.content_start("Matter Create new endpoint") #- title of the web page -#
webserver.content_send_style() #- send standard Tasmota styles -#
var url = webserver.arg("url")
if self.matter_enabled()
self.show_remote_autoconf(url)
end
webserver.content_button(webserver.BUTTON_CONFIGURATION)
webserver.content_stop() #- end of web page -#
end
#######################################################################
# Web Controller, called by POST to `/part_wiz`
# Web Controller, called by POST to `/matterc`
#######################################################################
def page_part_ctl()
import webserver
@ -356,6 +676,11 @@ class Matter_UI
try
# debug information about parameters
for i:0..webserver.arg_size()-1
tasmota.log(string.format("MTR: Arg%i '%s' = '%s'", i, webserver.arg_name(i), webserver.arg(i)))
end
#---------------------------------------------------------------------#
# Change Passcode and/or Passcode
#---------------------------------------------------------------------#
@ -373,33 +698,32 @@ class Matter_UI
#- and force restart -#
webserver.redirect("/?rst=")
#---------------------------------------------------------------------#
# Enable or Disable Commissioning
#---------------------------------------------------------------------#
elif webserver.has_arg("open_comm")
self.device.start_root_basic_commissioning()
webserver.redirect("/")
elif webserver.has_arg("clos_comm")
self.device.stop_basic_commissioning()
webserver.redirect("/")
elif webserver.has_arg("save")
var matter_enabled_requested = webserver.has_arg("menable")
var matter_commissioning_requested = webserver.has_arg("comm")
#---------------------------------------------------------------------#
# Enable Matter
#---------------------------------------------------------------------#
elif webserver.has_arg("enable")
tasmota.log(string.format("MTR: /matterc received '%s' command", 'enable'), 3)
tasmota.cmd("SetOption" + str(matter.MATTER_OPTION) + " 1")
#- and force restart -#
webserver.redirect("/?rst=")
#---------------------------------------------------------------------#
# Disable Matter
#---------------------------------------------------------------------#
elif webserver.has_arg("disable")
tasmota.log(string.format("MTR: /matterc received '%s' command", 'disable'), 3)
tasmota.cmd("SetOption" + str(matter.MATTER_OPTION) + " 0")
#- and force restart -#
webserver.redirect("/?rst=")
if matter_enabled_requested != self.matter_enabled()
if matter_enabled_requested
tasmota.log(string.format("MTR: /matterc received '%s' command", 'enable'), 3)
tasmota.cmd("SetOption" + str(matter.MATTER_OPTION) + " 1")
else
tasmota.log(string.format("MTR: /matterc received '%s' command", 'disable'), 3)
tasmota.cmd("SetOption" + str(matter.MATTER_OPTION) + " 0")
end
#- and force restart -#
webserver.redirect("/?rst=")
elif matter_commissioning_requested != (self.device.commissioning_open != nil)
if matter_commissioning_requested
self.device.start_root_basic_commissioning()
else
self.device.stop_basic_commissioning()
end
#- and force restart -#
webserver.redirect("/")
else
webserver.redirect("/")
end
#---------------------------------------------------------------------#
# Delete Fabric
@ -434,56 +758,130 @@ class Matter_UI
# Apply new configuration template
#---------------------------------------------------------------------#
elif webserver.has_arg("config")
var config = {}
tasmota.log(string.format("MTR: /matterc received '%s' command", 'config'), 3)
# iterate by id
var idx = 0
var idx_str = string.format("%03i", idx)
while webserver.has_arg('ep'+idx_str)
var needs_saving = false
# iterate by endpoint number
for i:0..webserver.arg_size()-1
var arg_name = webserver.arg_name(i)
if string.find(arg_name, "arg") == 0
var arg_ep = int(arg_name[3..]) # target endpoint as int
var arg = webserver.arg(i) # text value
var ep = webserver.arg('ep'+idx_str)
var ep_int = int(ep)
var typ = webserver.arg('pi'+idx_str)
var arg = webserver.arg('arg'+idx_str)
tasmota.log(string.format("MTR: ep=%i type=%s arg=%s", ep, typ, arg), 3)
var conf_ep = self.device.plugins_config.find(str(arg_ep)) # find the corresponding configuration map
if ep != '' && typ != '' && ep != '0'
# check if type exists
var typ_class = self.device.plugins_classes.find(typ)
if typ_class != nil
var elt = {'type':typ}
typ_class.ui_string_to_conf(typ_class, elt, arg)
# var arg_name = typ_class.ARG
# var arg_type = typ_class.ARG_TYPE
# if arg && arg_name
# elt[arg_name] = arg_type(arg)
# end
config[ep] = elt
if conf_ep != nil # found
var typ_class = self.device.plugins_classes.find(conf_ep.find('type', ''))
if typ_class != nil
tasmota.log(string.format("MTR: ep=%i arg=%s", arg_ep, arg), 3)
# compute the actual value
var prev_arg = typ_class.ui_conf_to_string(typ_class, conf_ep)
var changed = (prev_arg != arg)
tasmota.log(string.format("MTR: ep=%i prev_arg='%s' arg='%s' %s", arg_ep, prev_arg, arg, prev_arg != arg ? "changed" : ""), 3)
else
tasmota.log(string.format("MTR: unknown type = %s", typ), 2)
if changed
needs_saving = true
typ_class.ui_string_to_conf(typ_class, conf_ep, arg)
var pl = self.device.find_plugin_by_endpoint(arg_ep)
if pl
tasmota.log(string.format("MTR: apply conf '%s' (%i) to %s", conf_ep, arg_ep, pl), 3)
pl.parse_configuration(conf_ep)
end
end
end
else
tasmota.log(string.format("MTR: ep=%i not found", arg_ep), 3)
end
else
tasmota.log("MTR: skipping parameter", 2)
end
idx += 1
idx_str = string.format("%03i", idx)
end
tasmota.log(string.format("MTR: config = %s", str(config)), 3)
tasmota.log(string.format("MTR: config = %s", str(self.device.plugins_config)), 3)
if error
tasmota.log(string.format("MTR: config error = %s", error), 3)
else
self.device.plugins_config = config
self.device.plugins_persist = true
self.device.save_param()
#- and force restart -#
webserver.redirect("/?rst=")
if needs_saving || !self.device.plugins_persist
self.device.plugins_persist = true
self.device.save_param()
end
#- and reload -#
webserver.redirect("/cn?")
end
#---------------------------------------------------------------------#
# Add new endpoint for local sensor or device
#---------------------------------------------------------------------#
elif webserver.has_arg("addep")
var typ = webserver.arg('pi')
var arg = webserver.arg('arg')
tasmota.log(string.format("MTR: add endpoint typ='%s' arg='%s'", typ, arg), 3)
# check if type exists
var typ_class = self.device.plugins_classes.find(typ)
if typ_class != nil
var config = {}
typ_class.ui_string_to_conf(typ_class, config, arg)
self.device.bridge_add_endpoint(typ, config)
end
#- and reload -#
webserver.redirect("/matterc?")
#---------------------------------------------------------------------#
# Add new endpoint for local sensor or device
#---------------------------------------------------------------------#
elif webserver.has_arg("addrem")
var url = webserver.arg('url')
if url == nil || url == '' raise "value_error", "url shouldn't be null" end
# iterate by id
var idx = 0
var idx_str = str(idx)
while webserver.has_arg('pi'+idx_str)
var typ = webserver.arg('pi'+idx_str)
var arg = webserver.arg('arg'+idx_str)
if typ != ''
# check if type exists
var typ_class = self.device.plugins_classes.find(typ)
if typ_class != nil
var config = {'url': url, 'type': typ}
typ_class.ui_string_to_conf(typ_class, config, arg)
# check if configuration is already present
var duplicate = false
for c: self.device.plugins_config # iterate on values, not on keys()
# tasmota.log(string.format("MTR: map_compare '%s' ?= '%s' -> %s", str(c), str(config), str(self.equal_map(c,config))), 3)
if self.equal_map(c,config) duplicate = true break end
end
# not a duplicate, add it
if !duplicate
tasmota.log(string.format("MTR: remote add url='%s' type='%s' arg='%s'", url, typ, arg), 3)
self.device.bridge_add_endpoint(typ, config)
end
end
end
idx += 1
idx_str = str(idx)
end
#- and go back to Matter configuration -#
webserver.redirect("/matterc?")
else
#---------------------------------------------------------------------#
# Check if an endpoint needs to be deleted
#---------------------------------------------------------------------#
var ep_deleted
for i:0..webserver.arg_size()-1
var arg_name = webserver.arg_name(i)
if string.find(arg_name, "del") == 0
ep_deleted = int(arg_name[3..])
break
end
end
# check if we found an endpoint to be deleted
if ep_deleted != nil
tasmota.log(string.format("MTR: deleting endpoint %i", ep_deleted), 2)
self.device.bridge_remove_endpoint(ep_deleted)
webserver.redirect("/matterc?")
end
end
@ -561,9 +959,7 @@ class Matter_UI
import webserver
import string
var matter_enabled = tasmota.get_option(matter.MATTER_OPTION)
if matter_enabled
if self.matter_enabled()
# mtc0 = close, mtc1 = open commissioning
var fabrics_count = self.device.sessions.count_active_fabrics()
@ -580,16 +976,6 @@ class Matter_UI
self.show_commissioning_info()
end
# display the open/close commissioning button only if there is no active session
if fabrics_count == 0
webserver.content_send(string.format("<button onclick='la(\"&mtc%i=1\");'>", self.device.commissioning_open == nil ? 1 : 0))
webserver.content_send(matter._LOGO)
if self.device.commissioning_open == nil
webserver.content_send(" Open Commissioning</button>")
else
webserver.content_send(" Close Commissioning</button>")
end
end
end
end
@ -611,6 +997,8 @@ class Matter_UI
#- we need to register a closure, not just a function, that captures the current instance -#
webserver.on("/matterc", / -> self.page_part_mgr(), webserver.HTTP_GET)
webserver.on("/matterc", / -> self.page_part_ctl(), webserver.HTTP_POST)
webserver.on("/mattera", / -> self.page_part_mgr_adv(), webserver.HTTP_GET) # advanced
webserver.on("/matteradd", / -> self.page_part_mgr_add(), webserver.HTTP_GET) # add endpoint
end
end
matter.UI = Matter_UI

View File

@ -6,6 +6,111 @@
extern const bclass be_class_Matter_Plugin_Bridge_HTTP;
/********************************************************************
** Solidified function: read_attribute
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_read_attribute, /* name */
be_nested_proto(
10, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 9]) { /* 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(create_TLV),
/* K5 */ be_nested_str_weak(BOOL),
/* K6 */ be_nested_str_weak(http_remote),
/* K7 */ be_nested_str_weak(reachable),
/* K8 */ be_nested_str_weak(read_attribute),
}),
be_str_weak(read_attribute),
&be_const_str_solidified,
( &(const binstruction[35]) { /* code */
0xB80E0000, // 0000 GETNGBL R3 K0
0x880C0701, // 0001 GETMBR R3 R3 K1
0x88100502, // 0002 GETMBR R4 R2 K2
0x88140503, // 0003 GETMBR R5 R2 K3
0x541A0038, // 0004 LDINT R6 57
0x1C180806, // 0005 EQ R6 R4 R6
0x781A0012, // 0006 JMPF R6 #001A
0x541A0010, // 0007 LDINT R6 17
0x1C180A06, // 0008 EQ R6 R5 R6
0x781A0006, // 0009 JMPF R6 #0011
0x8C180704, // 000A GETMET R6 R3 K4
0x88200705, // 000B GETMBR R8 R3 K5
0x88240106, // 000C GETMBR R9 R0 K6
0x88241307, // 000D GETMBR R9 R9 K7
0x7C180600, // 000E CALL R6 3
0x80040C00, // 000F RET 1 R6
0x70020007, // 0010 JMP #0019
0x60180003, // 0011 GETGBL R6 G3
0x5C1C0000, // 0012 MOVE R7 R0
0x7C180200, // 0013 CALL R6 1
0x8C180D08, // 0014 GETMET R6 R6 K8
0x5C200200, // 0015 MOVE R8 R1
0x5C240400, // 0016 MOVE R9 R2
0x7C180600, // 0017 CALL R6 3
0x80040C00, // 0018 RET 1 R6
0x70020007, // 0019 JMP #0022
0x60180003, // 001A GETGBL R6 G3
0x5C1C0000, // 001B MOVE R7 R0
0x7C180200, // 001C CALL R6 1
0x8C180D08, // 001D GETMET R6 R6 K8
0x5C200200, // 001E MOVE R8 R1
0x5C240400, // 001F MOVE R9 R2
0x7C180600, // 0020 CALL R6 3
0x80040C00, // 0021 RET 1 R6
0x80000000, // 0022 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: web_value_onoff
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_web_value_onoff, /* name */
be_nested_proto(
3, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(_X3Cb_X3EOn_X3C_X2Fb_X3E),
/* K1 */ be_nested_str_weak(Off),
/* K2 */ be_nested_str_weak(),
}),
be_str_weak(web_value_onoff),
&be_const_str_solidified,
( &(const binstruction[10]) { /* code */
0x4C080000, // 0000 LDNIL R2
0x20080202, // 0001 NE R2 R1 R2
0x780A0004, // 0002 JMPF R2 #0008
0x78060001, // 0003 JMPF R1 #0006
0x58080000, // 0004 LDCONST R2 K0
0x70020000, // 0005 JMP #0007
0x58080001, // 0006 LDCONST R2 K1
0x70020000, // 0007 JMP #0009
0x58080002, // 0008 LDCONST R2 K2
0x80040400, // 0009 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: update_shadow
********************************************************************/
@ -49,116 +154,6 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_update_shadow, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: register_cmd_cb
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_register_cmd_cb, /* name */
be_nested_proto(
6, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
1, /* has sup protos */
( &(const struct bproto*[ 1]) {
be_nested_proto(
8, /* nstack */
3, /* argc */
0, /* varg */
1, /* has upvals */
( &(const bupvaldesc[ 1]) { /* upvals */
be_local_const_upval(1, 0),
}),
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(parse_http_response),
}),
be_str_weak(_X3Clambda_X3E),
&be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */
0x680C0000, // 0000 GETUPV R3 U0
0x8C0C0700, // 0001 GETMET R3 R3 K0
0x5C140000, // 0002 MOVE R5 R0
0x5C180200, // 0003 MOVE R6 R1
0x5C1C0400, // 0004 MOVE R7 R2
0x7C0C0800, // 0005 CALL R3 4
0x80040600, // 0006 RET 1 R3
})
),
}),
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_weak(http_remote),
/* K1 */ be_nested_str_weak(add_schedule),
/* K2 */ be_nested_str_weak(UPDATE_CMD),
/* K3 */ be_nested_str_weak(UPDATE_TIME),
}),
be_str_weak(register_cmd_cb),
&be_const_str_solidified,
( &(const binstruction[ 8]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x8C040301, // 0001 GETMET R1 R1 K1
0x880C0102, // 0002 GETMBR R3 R0 K2
0x88100103, // 0003 GETMBR R4 R0 K3
0x84140000, // 0004 CLOSURE R5 P0
0x7C040800, // 0005 CALL R1 4
0xA0000000, // 0006 CLOSE R0
0x80000000, // 0007 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: ui_conf_to_string
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_ui_conf_to_string, /* name */
be_nested_proto(
9, /* nstack */
2, /* argc */
4, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_const_class(be_class_Matter_Plugin_Bridge_HTTP),
/* K1 */ be_nested_str_weak(ui_conf_to_string),
/* K2 */ be_nested_str_weak(find),
/* K3 */ be_nested_str_weak(ARG_HTTP),
/* K4 */ be_nested_str_weak(),
/* K5 */ be_nested_str_weak(_X2C),
}),
be_str_weak(ui_conf_to_string),
&be_const_str_solidified,
( &(const binstruction[17]) { /* code */
0x58080000, // 0000 LDCONST R2 K0
0x600C0003, // 0001 GETGBL R3 G3
0x5C100400, // 0002 MOVE R4 R2
0x7C0C0200, // 0003 CALL R3 1
0x8C0C0701, // 0004 GETMET R3 R3 K1
0x5C140000, // 0005 MOVE R5 R0
0x5C180200, // 0006 MOVE R6 R1
0x7C0C0600, // 0007 CALL R3 3
0x60100008, // 0008 GETGBL R4 G8
0x8C140302, // 0009 GETMET R5 R1 K2
0x881C0503, // 000A GETMBR R7 R2 K3
0x58200004, // 000B LDCONST R8 K4
0x7C140600, // 000C CALL R5 3
0x7C100200, // 000D CALL R4 1
0x00140705, // 000E ADD R5 R3 K5
0x00140A04, // 000F ADD R5 R5 R4
0x80040A00, // 0010 RET 1 R5
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: parse_http_response
********************************************************************/
@ -234,60 +229,6 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_parse_http_response, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_init, /* name */
be_nested_proto(
10, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 9]) { /* constants */
/* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(init),
/* K2 */ be_nested_str_weak(find),
/* K3 */ be_nested_str_weak(ARG_HTTP),
/* K4 */ be_nested_str_weak(http_remote),
/* K5 */ be_nested_str_weak(device),
/* K6 */ be_nested_str_weak(register_http_remote),
/* K7 */ be_nested_str_weak(PROBE_TIMEOUT),
/* K8 */ be_nested_str_weak(register_cmd_cb),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[21]) { /* code */
0xA4120000, // 0000 IMPORT R4 K0
0x60140003, // 0001 GETGBL R5 G3
0x5C180000, // 0002 MOVE R6 R0
0x7C140200, // 0003 CALL R5 1
0x8C140B01, // 0004 GETMET R5 R5 K1
0x5C1C0200, // 0005 MOVE R7 R1
0x5C200400, // 0006 MOVE R8 R2
0x5C240600, // 0007 MOVE R9 R3
0x7C140800, // 0008 CALL R5 4
0x8C140702, // 0009 GETMET R5 R3 K2
0x881C0103, // 000A GETMBR R7 R0 K3
0x7C140400, // 000B CALL R5 2
0x88180105, // 000C GETMBR R6 R0 K5
0x8C180D06, // 000D GETMET R6 R6 K6
0x5C200A00, // 000E MOVE R8 R5
0x88240107, // 000F GETMBR R9 R0 K7
0x7C180600, // 0010 CALL R6 3
0x90020806, // 0011 SETMBR R0 K4 R6
0x8C180108, // 0012 GETMET R6 R0 K8
0x7C180200, // 0013 CALL R6 1
0x80000000, // 0014 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: call_remote_sync
********************************************************************/
@ -370,150 +311,6 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_call_remote_sync, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: parse_update
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_parse_update, /* name */
be_nested_proto(
3, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(parse_update),
&be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */
0x80000000, // 0000 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: ui_string_to_conf
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_ui_string_to_conf, /* name */
be_nested_proto(
11, /* nstack */
3, /* argc */
4, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 9]) { /* constants */
/* K0 */ be_const_class(be_class_Matter_Plugin_Bridge_HTTP),
/* K1 */ be_nested_str_weak(string),
/* K2 */ be_nested_str_weak(split),
/* K3 */ be_nested_str_weak(_X2C),
/* K4 */ be_const_int(3),
/* K5 */ be_nested_str_weak(ARG_HTTP),
/* K6 */ be_const_int(1),
/* K7 */ be_nested_str_weak(ui_string_to_conf),
/* K8 */ be_const_int(0),
}),
be_str_weak(ui_string_to_conf),
&be_const_str_solidified,
( &(const binstruction[19]) { /* code */
0x580C0000, // 0000 LDCONST R3 K0
0xA4120200, // 0001 IMPORT R4 K1
0x8C140902, // 0002 GETMET R5 R4 K2
0x001C0503, // 0003 ADD R7 R2 K3
0x58200003, // 0004 LDCONST R8 K3
0x58240004, // 0005 LDCONST R9 K4
0x7C140800, // 0006 CALL R5 4
0x88180705, // 0007 GETMBR R6 R3 K5
0x941C0B06, // 0008 GETIDX R7 R5 K6
0x98040C07, // 0009 SETIDX R1 R6 R7
0x60180003, // 000A GETGBL R6 G3
0x5C1C0600, // 000B MOVE R7 R3
0x7C180200, // 000C CALL R6 1
0x8C180D07, // 000D GETMET R6 R6 K7
0x5C200000, // 000E MOVE R8 R0
0x5C240200, // 000F MOVE R9 R1
0x94280B08, // 0010 GETIDX R10 R5 K8
0x7C180800, // 0011 CALL R6 4
0x80040200, // 0012 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read_attribute
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_read_attribute, /* name */
be_nested_proto(
10, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 9]) { /* 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(create_TLV),
/* K5 */ be_nested_str_weak(BOOL),
/* K6 */ be_nested_str_weak(http_remote),
/* K7 */ be_nested_str_weak(reachable),
/* K8 */ be_nested_str_weak(read_attribute),
}),
be_str_weak(read_attribute),
&be_const_str_solidified,
( &(const binstruction[35]) { /* code */
0xB80E0000, // 0000 GETNGBL R3 K0
0x880C0701, // 0001 GETMBR R3 R3 K1
0x88100502, // 0002 GETMBR R4 R2 K2
0x88140503, // 0003 GETMBR R5 R2 K3
0x541A0038, // 0004 LDINT R6 57
0x1C180806, // 0005 EQ R6 R4 R6
0x781A0012, // 0006 JMPF R6 #001A
0x541A0010, // 0007 LDINT R6 17
0x1C180A06, // 0008 EQ R6 R5 R6
0x781A0006, // 0009 JMPF R6 #0011
0x8C180704, // 000A GETMET R6 R3 K4
0x88200705, // 000B GETMBR R8 R3 K5
0x88240106, // 000C GETMBR R9 R0 K6
0x88241307, // 000D GETMBR R9 R9 K7
0x7C180600, // 000E CALL R6 3
0x80040C00, // 000F RET 1 R6
0x70020007, // 0010 JMP #0019
0x60180003, // 0011 GETGBL R6 G3
0x5C1C0000, // 0012 MOVE R7 R0
0x7C180200, // 0013 CALL R6 1
0x8C180D08, // 0014 GETMET R6 R6 K8
0x5C200200, // 0015 MOVE R8 R1
0x5C240400, // 0016 MOVE R9 R2
0x7C180600, // 0017 CALL R6 3
0x80040C00, // 0018 RET 1 R6
0x70020007, // 0019 JMP #0022
0x60180003, // 001A GETGBL R6 G3
0x5C1C0000, // 001B MOVE R7 R0
0x7C180200, // 001C CALL R6 1
0x8C180D08, // 001D GETMET R6 R6 K8
0x5C200200, // 001E MOVE R8 R1
0x5C240400, // 001F MOVE R9 R2
0x7C180600, // 0020 CALL R6 3
0x80040C00, // 0021 RET 1 R6
0x80000000, // 0022 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: every_250ms
********************************************************************/
@ -545,36 +342,24 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_every_250ms, /* name */
/********************************************************************
** Solidified function: web_value_onoff
** Solidified function: is_local_device
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_web_value_onoff, /* name */
be_local_closure(Matter_Plugin_Bridge_HTTP_is_local_device, /* name */
be_nested_proto(
3, /* nstack */
2, /* argc */
2, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str_weak(_X3Cb_X3EOn_X3C_X2Fb_X3E),
/* K1 */ be_nested_str_weak(Off),
/* K2 */ be_nested_str_weak(),
}),
be_str_weak(web_value_onoff),
0, /* has constants */
NULL, /* no const */
be_str_weak(is_local_device),
&be_const_str_solidified,
( &(const binstruction[10]) { /* code */
0x4C080000, // 0000 LDNIL R2
0x20080202, // 0001 NE R2 R1 R2
0x780A0004, // 0002 JMPF R2 #0008
0x78060001, // 0003 JMPF R1 #0006
0x58080000, // 0004 LDCONST R2 K0
0x70020000, // 0005 JMP #0007
0x58080001, // 0006 LDCONST R2 K1
0x70020000, // 0007 JMP #0009
0x58080002, // 0008 LDCONST R2 K2
0x80040400, // 0009 RET 1 R2
( &(const binstruction[ 2]) { /* code */
0x50040000, // 0000 LDBOOL R1 0 0
0x80040200, // 0001 RET 1 R1
})
)
);
@ -617,6 +402,147 @@ be_local_closure(Matter_Plugin_Bridge_HTTP_web_values, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: parse_update
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_parse_update, /* name */
be_nested_proto(
3, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(parse_update),
&be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */
0x80000000, // 0000 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_init, /* name */
be_nested_proto(
10, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 9]) { /* constants */
/* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(init),
/* K2 */ be_nested_str_weak(find),
/* K3 */ be_nested_str_weak(ARG_HTTP),
/* K4 */ be_nested_str_weak(http_remote),
/* K5 */ be_nested_str_weak(device),
/* K6 */ be_nested_str_weak(register_http_remote),
/* K7 */ be_nested_str_weak(PROBE_TIMEOUT),
/* K8 */ be_nested_str_weak(register_cmd_cb),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[21]) { /* code */
0xA4120000, // 0000 IMPORT R4 K0
0x60140003, // 0001 GETGBL R5 G3
0x5C180000, // 0002 MOVE R6 R0
0x7C140200, // 0003 CALL R5 1
0x8C140B01, // 0004 GETMET R5 R5 K1
0x5C1C0200, // 0005 MOVE R7 R1
0x5C200400, // 0006 MOVE R8 R2
0x5C240600, // 0007 MOVE R9 R3
0x7C140800, // 0008 CALL R5 4
0x8C140702, // 0009 GETMET R5 R3 K2
0x881C0103, // 000A GETMBR R7 R0 K3
0x7C140400, // 000B CALL R5 2
0x88180105, // 000C GETMBR R6 R0 K5
0x8C180D06, // 000D GETMET R6 R6 K6
0x5C200A00, // 000E MOVE R8 R5
0x88240107, // 000F GETMBR R9 R0 K7
0x7C180600, // 0010 CALL R6 3
0x90020806, // 0011 SETMBR R0 K4 R6
0x8C180108, // 0012 GETMET R6 R0 K8
0x7C180200, // 0013 CALL R6 1
0x80000000, // 0014 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: register_cmd_cb
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_HTTP_register_cmd_cb, /* name */
be_nested_proto(
6, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
1, /* has sup protos */
( &(const struct bproto*[ 1]) {
be_nested_proto(
8, /* nstack */
3, /* argc */
0, /* varg */
1, /* has upvals */
( &(const bupvaldesc[ 1]) { /* upvals */
be_local_const_upval(1, 0),
}),
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(parse_http_response),
}),
be_str_weak(_X3Clambda_X3E),
&be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */
0x680C0000, // 0000 GETUPV R3 U0
0x8C0C0700, // 0001 GETMET R3 R3 K0
0x5C140000, // 0002 MOVE R5 R0
0x5C180200, // 0003 MOVE R6 R1
0x5C1C0400, // 0004 MOVE R7 R2
0x7C0C0800, // 0005 CALL R3 4
0x80040600, // 0006 RET 1 R3
})
),
}),
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_weak(http_remote),
/* K1 */ be_nested_str_weak(add_schedule),
/* K2 */ be_nested_str_weak(UPDATE_CMD),
/* K3 */ be_nested_str_weak(UPDATE_TIME),
}),
be_str_weak(register_cmd_cb),
&be_const_str_solidified,
( &(const binstruction[ 8]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x8C040301, // 0001 GETMET R1 R1 K1
0x880C0102, // 0002 GETMBR R3 R0 K2
0x88100103, // 0003 GETMBR R4 R0 K3
0x84140000, // 0004 CLOSURE R5 P0
0x7C040800, // 0005 CALL R1 4
0xA0000000, // 0006 CLOSE R0
0x80000000, // 0007 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_Plugin_Bridge_HTTP
********************************************************************/
@ -624,33 +550,32 @@ extern const bclass be_class_Matter_Plugin_Device;
be_local_class(Matter_Plugin_Bridge_HTTP,
1,
&be_class_Matter_Plugin_Device,
be_nested_map(22,
be_nested_map(21,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(NAME, 2), be_nested_str_weak() },
{ be_const_key_weak(web_values, 11), be_const_closure(Matter_Plugin_Bridge_HTTP_web_values_closure) },
{ be_const_key_weak(web_value_onoff, 21), be_const_closure(Matter_Plugin_Bridge_HTTP_web_value_onoff_closure) },
{ be_const_key_weak(register_cmd_cb, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_register_cmd_cb_closure) },
{ be_const_key_weak(ui_conf_to_string, -1), be_const_static_closure(Matter_Plugin_Bridge_HTTP_ui_conf_to_string_closure) },
{ be_const_key_weak(http_remote, -1), be_const_var(0) },
{ be_const_key_weak(CLUSTERS, 0), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_read_attribute_closure) },
{ be_const_key_weak(web_value_onoff, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_web_value_onoff_closure) },
{ be_const_key_weak(SYNC_TIMEOUT, -1), be_const_int(500) },
{ be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(0,
( (struct bmapnode*) &(const bmapnode[]) {
})) ) } )) },
{ be_const_key_weak(is_local_device, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_is_local_device_closure) },
{ be_const_key_weak(parse_http_response, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_parse_http_response_closure) },
{ be_const_key_weak(init, 18), be_const_closure(Matter_Plugin_Bridge_HTTP_init_closure) },
{ be_const_key_weak(update_shadow, 3), be_const_closure(Matter_Plugin_Bridge_HTTP_update_shadow_closure) },
{ be_const_key_weak(every_250ms, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_every_250ms_closure) },
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(3000) },
{ be_const_key_weak(TYPE, 4), be_nested_str_weak() },
{ be_const_key_weak(web_values, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_web_values_closure) },
{ be_const_key_weak(ARG_HTTP, 6), be_nested_str_weak(url) },
{ be_const_key_weak(PROBE_TIMEOUT, -1), be_const_int(1700) },
{ be_const_key_weak(ARG, -1), be_nested_str_weak() },
{ be_const_key_weak(UPDATE_CMD, -1), be_nested_str_weak(Status_X2011) },
{ be_const_key_weak(parse_http_response, 19), be_const_closure(Matter_Plugin_Bridge_HTTP_parse_http_response_closure) },
{ be_const_key_weak(call_remote_sync, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_call_remote_sync_closure) },
{ be_const_key_weak(NAME, 14), be_nested_str_weak() },
{ be_const_key_weak(call_remote_sync, 17), be_const_closure(Matter_Plugin_Bridge_HTTP_call_remote_sync_closure) },
{ be_const_key_weak(parse_update, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_parse_update_closure) },
{ be_const_key_weak(ARG_HTTP, 16), be_nested_str_weak(url) },
{ be_const_key_weak(TYPE, -1), be_nested_str_weak() },
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_read_attribute_closure) },
{ be_const_key_weak(PROBE_TIMEOUT, 13), be_const_int(1700) },
{ be_const_key_weak(ui_string_to_conf, -1), be_const_static_closure(Matter_Plugin_Bridge_HTTP_ui_string_to_conf_closure) },
{ be_const_key_weak(update_shadow, 8), be_const_closure(Matter_Plugin_Bridge_HTTP_update_shadow_closure) },
{ be_const_key_weak(every_250ms, 5), be_const_closure(Matter_Plugin_Bridge_HTTP_every_250ms_closure) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_init_closure) },
{ be_const_key_weak(UPDATE_TIME, 1), be_const_int(3000) },
{ be_const_key_weak(SYNC_TIMEOUT, -1), be_const_int(500) },
{ be_const_key_weak(UPDATE_CMD, -1), be_nested_str_weak(Status_X2011) },
{ be_const_key_weak(http_remote, -1), be_const_var(0) },
{ be_const_key_weak(register_cmd_cb, -1), be_const_closure(Matter_Plugin_Bridge_HTTP_register_cmd_cb_closure) },
})),
be_str_weak(Matter_Plugin_Bridge_HTTP)
);

View File

@ -418,7 +418,7 @@ be_local_class(Matter_Plugin_Bridge_Light0,
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Bridge_Light0_init_closure) },
{ be_const_key_weak(set_onoff, 13), be_const_closure(Matter_Plugin_Bridge_Light0_set_onoff_closure) },
{ be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Bridge_Light0_invoke_request_closure) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Light_X200_X20On) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X200_X20On) },
{ be_const_key_weak(tasmota_relay_index, -1), be_const_var(0) },
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,

View File

@ -526,7 +526,7 @@ be_local_class(Matter_Plugin_Bridge_Light1,
})) ) } )) },
})) ) } )) },
{ be_const_key_weak(set_bri, -1), be_const_closure(Matter_Plugin_Bridge_Light1_set_bri_closure) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Light_X201_X20Dimmer) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X201_X20Dimmer) },
{ be_const_key_weak(web_values, 1), be_const_closure(Matter_Plugin_Bridge_Light1_web_values_closure) },
{ be_const_key_weak(invoke_request, 0), be_const_closure(Matter_Plugin_Bridge_Light1_invoke_request_closure) },
})),

View File

@ -570,7 +570,7 @@ be_local_class(Matter_Plugin_Bridge_Light2,
{ be_const_key_weak(web_value_ct, -1), be_const_closure(Matter_Plugin_Bridge_Light2_web_value_ct_closure) },
{ be_const_key_weak(set_ct, -1), be_const_closure(Matter_Plugin_Bridge_Light2_set_ct_closure) },
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Bridge_Light2_read_attribute_closure) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Light_X202_X20CT) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X202_X20CT) },
{ be_const_key_weak(shadow_ct, -1), be_const_var(0) },
{ be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Bridge_Light2_invoke_request_closure) },
{ be_const_key_weak(update_ct_minmax, 8), be_const_closure(Matter_Plugin_Bridge_Light2_update_ct_minmax_closure) },

View File

@ -713,7 +713,7 @@ be_local_class(Matter_Plugin_Bridge_Light3,
{ be_const_key_weak(web_value_RGB, 1), be_const_closure(Matter_Plugin_Bridge_Light3_web_value_RGB_closure) },
{ be_const_key_weak(shadow_sat, 9), be_const_var(1) },
{ be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_Bridge_Light3_invoke_request_closure) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Light_X203_X20RGB) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Light_X203_X20RGB) },
{ be_const_key_weak(TYPES, 11), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {

View File

@ -61,7 +61,7 @@ be_local_class(Matter_Plugin_Bridge_OnOff,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(web_values, -1), be_const_closure(Matter_Plugin_Bridge_OnOff_web_values_closure) },
{ be_const_key_weak(TYPE, -1), be_nested_str_weak(http_relay) },
{ be_const_key_weak(NAME, 3), be_nested_str_weak(_X26_X23x1F517_X3B_X20Relay) },
{ be_const_key_weak(NAME, 3), be_nested_str_weak(Relay) },
{ 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[]) {

View File

@ -6,6 +6,30 @@
extern const bclass be_class_Matter_Plugin_Bridge_Sensor;
/********************************************************************
** Solidified function: pre_value
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_Sensor_pre_value, /* name */
be_nested_proto(
2, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(pre_value),
&be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */
0x80040200, // 0000 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: filter_name_html
********************************************************************/
@ -52,76 +76,43 @@ be_local_closure(Matter_Plugin_Bridge_Sensor_filter_name_html, /* name */
/********************************************************************
** Solidified function: init
** Solidified function: parse_configuration
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_Sensor_init, /* name */
be_local_closure(Matter_Plugin_Bridge_Sensor_parse_configuration, /* name */
be_nested_proto(
9, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(tasmota_sensor_filter),
/* K2 */ be_nested_str_weak(find),
/* K3 */ be_nested_str_weak(ARG),
/* K4 */ be_nested_str_weak(tasmota_sensor_matcher),
/* K5 */ be_nested_str_weak(tasmota),
/* K6 */ be_nested_str_weak(Rule_Matcher),
/* K7 */ be_nested_str_weak(parse),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[21]) { /* 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
0x8C100702, // 0008 GETMET R4 R3 K2
0x88180103, // 0009 GETMBR R6 R0 K3
0x7C100400, // 000A CALL R4 2
0x90020204, // 000B SETMBR R0 K1 R4
0x88100101, // 000C GETMBR R4 R0 K1
0x78120005, // 000D JMPF R4 #0014
0xB8120A00, // 000E GETNGBL R4 K5
0x88100906, // 000F GETMBR R4 R4 K6
0x8C100907, // 0010 GETMET R4 R4 K7
0x88180101, // 0011 GETMBR R6 R0 K1
0x7C100400, // 0012 CALL R4 2
0x90020804, // 0013 SETMBR R0 K4 R4
0x80000000, // 0014 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: pre_value
********************************************************************/
be_local_closure(Matter_Plugin_Bridge_Sensor_pre_value, /* name */
be_nested_proto(
2, /* nstack */
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
0, /* has constants */
NULL, /* no const */
be_str_weak(pre_value),
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota_sensor_filter),
/* K1 */ be_nested_str_weak(find),
/* K2 */ be_nested_str_weak(ARG),
/* K3 */ be_nested_str_weak(tasmota_sensor_matcher),
/* K4 */ be_nested_str_weak(tasmota),
/* K5 */ be_nested_str_weak(Rule_Matcher),
/* K6 */ be_nested_str_weak(parse),
}),
be_str_weak(parse_configuration),
&be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */
0x80040200, // 0000 RET 1 R1
( &(const binstruction[13]) { /* code */
0x8C080301, // 0000 GETMET R2 R1 K1
0x88100102, // 0001 GETMBR R4 R0 K2
0x7C080400, // 0002 CALL R2 2
0x90020002, // 0003 SETMBR R0 K0 R2
0x88080100, // 0004 GETMBR R2 R0 K0
0x780A0005, // 0005 JMPF R2 #000C
0xB80A0800, // 0006 GETNGBL R2 K4
0x88080505, // 0007 GETMBR R2 R2 K5
0x8C080506, // 0008 GETMET R2 R2 K6
0x88100100, // 0009 GETMBR R4 R0 K0
0x7C080400, // 000A CALL R2 2
0x90020602, // 000B SETMBR R0 K3 R2
0x80000000, // 000C RET 0
})
)
);
@ -217,16 +208,16 @@ be_local_class(Matter_Plugin_Bridge_Sensor,
{ be_const_key_weak(ARG, 1), be_nested_str_weak(filter) },
{ be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_value_changed_closure) },
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(5000) },
{ be_const_key_weak(tasmota_sensor_filter, 8), be_const_var(0) },
{ be_const_key_weak(pre_value, 12), be_const_closure(Matter_Plugin_Bridge_Sensor_pre_value_closure) },
{ be_const_key_weak(tasmota_sensor_matcher, -1), be_const_var(1) },
{ be_const_key_weak(PROBE_TIMEOUT, -1), be_const_int(1700) },
{ be_const_key_weak(filter_name_html, 12), be_const_closure(Matter_Plugin_Bridge_Sensor_filter_name_html_closure) },
{ be_const_key_weak(UPDATE_CMD, -1), be_nested_str_weak(Status_X208) },
{ be_const_key_weak(pre_value, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_pre_value_closure) },
{ be_const_key_weak(filter_name_html, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_filter_name_html_closure) },
{ be_const_key_weak(parse_configuration, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_parse_configuration_closure) },
{ be_const_key_weak(shadow_value, -1), be_const_var(2) },
{ be_const_key_weak(parse_update, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_parse_update_closure) },
{ be_const_key_weak(shadow_value, 7), be_const_var(2) },
{ be_const_key_weak(UPDATE_CMD, 8), be_nested_str_weak(Status_X208) },
{ be_const_key_weak(ARG_HTTP, 2), be_nested_str_weak(url) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_init_closure) },
{ be_const_key_weak(tasmota_sensor_filter, -1), be_const_var(0) },
})),
be_str_weak(Matter_Plugin_Bridge_Sensor)
);

View File

@ -259,7 +259,7 @@ be_local_class(Matter_Plugin_Bridge_Sensor_Humidity,
{ be_const_key_weak(read_attribute, 7), be_const_closure(Matter_Plugin_Bridge_Sensor_Humidity_read_attribute_closure) },
{ be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Humidity_value_changed_closure) },
{ be_const_key_weak(TYPE, 4), be_nested_str_weak(http_humidity) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Humidity) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Humidity) },
{ 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[]) {

View File

@ -263,7 +263,7 @@ be_local_class(Matter_Plugin_Bridge_Sensor_Illuminance,
{ be_const_key_weak(read_attribute, 7), be_const_closure(Matter_Plugin_Bridge_Sensor_Illuminance_read_attribute_closure) },
{ be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Illuminance_value_changed_closure) },
{ be_const_key_weak(TYPE, 4), be_nested_str_weak(http_illuminance) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Illuminance) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Illuminance) },
{ 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[]) {

View File

@ -323,7 +323,7 @@ be_local_class(Matter_Plugin_Bridge_Sensor_Occupancy,
{ be_const_key_weak(UPDATE_CMD, 9), be_nested_str_weak(Status_X208) },
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Occupancy_read_attribute_closure) },
{ be_const_key_weak(tasmota_switch_index, 11), be_const_var(0) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Occupancy) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Occupancy) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Occupancy_init_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,

View File

@ -250,7 +250,7 @@ be_local_class(Matter_Plugin_Bridge_Sensor_Pressure,
{ be_const_key_weak(read_attribute, 7), be_const_closure(Matter_Plugin_Bridge_Sensor_Pressure_read_attribute_closure) },
{ be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Pressure_value_changed_closure) },
{ be_const_key_weak(TYPE, 4), be_nested_str_weak(http_pressure) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Pressure) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Pressure) },
{ 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[]) {

View File

@ -256,7 +256,7 @@ be_local_class(Matter_Plugin_Bridge_Sensor_Temp,
{ be_const_key_weak(read_attribute, 7), be_const_closure(Matter_Plugin_Bridge_Sensor_Temp_read_attribute_closure) },
{ be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Bridge_Sensor_Temp_value_changed_closure) },
{ be_const_key_weak(TYPE, 4), be_nested_str_weak(http_temperature) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(_X26_X23x1F517_X3B_X20Temperature) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Temperature) },
{ 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[]) {

View File

@ -6,6 +6,43 @@
extern const bclass be_class_Matter_Plugin_OnOff;
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_init, /* name */
be_nested_proto(
9, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(shadow_onoff),
}),
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
0x50100000, // 0008 LDBOOL R4 0 0
0x90020204, // 0009 SETMBR R0 K1 R4
0x80000000, // 000A RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: <lambda>
********************************************************************/
@ -33,99 +70,6 @@ be_local_closure(Matter_Plugin_OnOff__X3Clambda_X3E, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_init, /* name */
be_nested_proto(
9, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(shadow_onoff),
/* K2 */ be_nested_str_weak(tasmota_relay_index),
/* K3 */ be_nested_str_weak(find),
/* K4 */ be_nested_str_weak(ARG),
/* K5 */ be_const_int(1),
/* K6 */ be_const_int(0),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[22]) { /* 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
0x50100000, // 0008 LDBOOL R4 0 0
0x90020204, // 0009 SETMBR R0 K1 R4
0x60100009, // 000A GETGBL R4 G9
0x8C140703, // 000B GETMET R5 R3 K3
0x881C0104, // 000C GETMBR R7 R0 K4
0x58200005, // 000D LDCONST R8 K5
0x7C140600, // 000E CALL R5 3
0x7C100200, // 000F CALL R4 1
0x90020404, // 0010 SETMBR R0 K2 R4
0x88100102, // 0011 GETMBR R4 R0 K2
0x18100906, // 0012 LE R4 R4 K6
0x78120000, // 0013 JMPF R4 #0015
0x90020505, // 0014 SETMBR R0 K2 K5
0x80000000, // 0015 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: set_onoff
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_set_onoff, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota),
/* K1 */ be_nested_str_weak(set_power),
/* K2 */ be_nested_str_weak(tasmota_relay_index),
/* K3 */ be_const_int(1),
/* K4 */ be_nested_str_weak(update_shadow),
}),
be_str_weak(set_onoff),
&be_const_str_solidified,
( &(const binstruction[11]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x04100903, // 0003 SUB R4 R4 K3
0x60140017, // 0004 GETGBL R5 G23
0x5C180200, // 0005 MOVE R6 R1
0x7C140200, // 0006 CALL R5 1
0x7C080600, // 0007 CALL R2 3
0x8C080104, // 0008 GETMET R2 R0 K4
0x7C080200, // 0009 CALL R2 1
0x80000000, // 000A RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: invoke_request
********************************************************************/
@ -203,6 +147,148 @@ be_local_closure(Matter_Plugin_OnOff_invoke_request, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: set_onoff
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_set_onoff, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota),
/* K1 */ be_nested_str_weak(set_power),
/* K2 */ be_nested_str_weak(tasmota_relay_index),
/* K3 */ be_const_int(1),
/* K4 */ be_nested_str_weak(update_shadow),
}),
be_str_weak(set_onoff),
&be_const_str_solidified,
( &(const binstruction[11]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x04100903, // 0003 SUB R4 R4 K3
0x60140017, // 0004 GETGBL R5 G23
0x5C180200, // 0005 MOVE R6 R1
0x7C140200, // 0006 CALL R5 1
0x7C080600, // 0007 CALL R2 3
0x8C080104, // 0008 GETMET R2 R0 K4
0x7C080200, // 0009 CALL R2 1
0x80000000, // 000A RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: update_shadow
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_update_shadow, /* name */
be_nested_proto(
6, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota),
/* K1 */ be_nested_str_weak(get_power),
/* K2 */ be_nested_str_weak(tasmota_relay_index),
/* K3 */ be_const_int(1),
/* K4 */ be_nested_str_weak(shadow_onoff),
/* K5 */ be_nested_str_weak(attribute_updated),
/* K6 */ be_const_int(0),
/* K7 */ be_nested_str_weak(update_shadow),
}),
be_str_weak(update_shadow),
&be_const_str_solidified,
( &(const binstruction[29]) { /* code */
0xB8060000, // 0000 GETNGBL R1 K0
0x8C040301, // 0001 GETMET R1 R1 K1
0x880C0102, // 0002 GETMBR R3 R0 K2
0x040C0703, // 0003 SUB R3 R3 K3
0x7C040400, // 0004 CALL R1 2
0x4C080000, // 0005 LDNIL R2
0x20080202, // 0006 NE R2 R1 R2
0x780A000E, // 0007 JMPF R2 #0017
0x88080104, // 0008 GETMBR R2 R0 K4
0x4C0C0000, // 0009 LDNIL R3
0x20080403, // 000A NE R2 R2 R3
0x780A0009, // 000B JMPF R2 #0016
0x88080104, // 000C GETMBR R2 R0 K4
0x600C0017, // 000D GETGBL R3 G23
0x5C100200, // 000E MOVE R4 R1
0x7C0C0200, // 000F CALL R3 1
0x20080403, // 0010 NE R2 R2 R3
0x780A0003, // 0011 JMPF R2 #0016
0x8C080105, // 0012 GETMET R2 R0 K5
0x54120005, // 0013 LDINT R4 6
0x58140006, // 0014 LDCONST R5 K6
0x7C080600, // 0015 CALL R2 3
0x90020801, // 0016 SETMBR R0 K4 R1
0x60080003, // 0017 GETGBL R2 G3
0x5C0C0000, // 0018 MOVE R3 R0
0x7C080200, // 0019 CALL R2 1
0x8C080507, // 001A GETMET R2 R2 K7
0x7C080200, // 001B CALL R2 1
0x80000000, // 001C RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: parse_configuration
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_parse_configuration, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota_relay_index),
/* K1 */ be_nested_str_weak(find),
/* K2 */ be_nested_str_weak(ARG),
/* K3 */ be_const_int(1),
/* K4 */ be_const_int(0),
}),
be_str_weak(parse_configuration),
&be_const_str_solidified,
( &(const binstruction[12]) { /* code */
0x60080009, // 0000 GETGBL R2 G9
0x8C0C0301, // 0001 GETMET R3 R1 K1
0x88140102, // 0002 GETMBR R5 R0 K2
0x58180003, // 0003 LDCONST R6 K3
0x7C0C0600, // 0004 CALL R3 3
0x7C080200, // 0005 CALL R2 1
0x90020002, // 0006 SETMBR R0 K0 R2
0x88080100, // 0007 GETMBR R2 R0 K0
0x18080504, // 0008 LE R2 R2 K4
0x780A0000, // 0009 JMPF R2 #000B
0x90020103, // 000A SETMBR R0 K0 K3
0x80000000, // 000B RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read_attribute
********************************************************************/
@ -284,67 +370,6 @@ be_local_closure(Matter_Plugin_OnOff_read_attribute, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: update_shadow
********************************************************************/
be_local_closure(Matter_Plugin_OnOff_update_shadow, /* name */
be_nested_proto(
6, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota),
/* K1 */ be_nested_str_weak(get_power),
/* K2 */ be_nested_str_weak(tasmota_relay_index),
/* K3 */ be_const_int(1),
/* K4 */ be_nested_str_weak(shadow_onoff),
/* K5 */ be_nested_str_weak(attribute_updated),
/* K6 */ be_const_int(0),
/* K7 */ be_nested_str_weak(update_shadow),
}),
be_str_weak(update_shadow),
&be_const_str_solidified,
( &(const binstruction[29]) { /* code */
0xB8060000, // 0000 GETNGBL R1 K0
0x8C040301, // 0001 GETMET R1 R1 K1
0x880C0102, // 0002 GETMBR R3 R0 K2
0x040C0703, // 0003 SUB R3 R3 K3
0x7C040400, // 0004 CALL R1 2
0x4C080000, // 0005 LDNIL R2
0x20080202, // 0006 NE R2 R1 R2
0x780A000E, // 0007 JMPF R2 #0017
0x88080104, // 0008 GETMBR R2 R0 K4
0x4C0C0000, // 0009 LDNIL R3
0x20080403, // 000A NE R2 R2 R3
0x780A0009, // 000B JMPF R2 #0016
0x88080104, // 000C GETMBR R2 R0 K4
0x600C0017, // 000D GETGBL R3 G23
0x5C100200, // 000E MOVE R4 R1
0x7C0C0200, // 000F CALL R3 1
0x20080403, // 0010 NE R2 R2 R3
0x780A0003, // 0011 JMPF R2 #0016
0x8C080105, // 0012 GETMET R2 R0 K5
0x54120005, // 0013 LDINT R4 6
0x58140006, // 0014 LDCONST R5 K6
0x7C080600, // 0015 CALL R2 3
0x90020801, // 0016 SETMBR R0 K4 R1
0x60080003, // 0017 GETGBL R2 G3
0x5C0C0000, // 0018 MOVE R3 R0
0x7C080200, // 0019 CALL R2 1
0x8C080507, // 001A GETMET R2 R2 K7
0x7C080200, // 001B CALL R2 1
0x80000000, // 001C RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_Plugin_OnOff
********************************************************************/
@ -352,8 +377,22 @@ extern const bclass be_class_Matter_Plugin_Device;
be_local_class(Matter_Plugin_OnOff,
2,
&be_class_Matter_Plugin_Device,
be_nested_map(14,
be_nested_map(15,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_OnOff_init_closure) },
{ be_const_key_weak(ARG, -1), be_nested_str_weak(relay) },
{ be_const_key_weak(invoke_request, -1), be_const_closure(Matter_Plugin_OnOff_invoke_request_closure) },
{ be_const_key_weak(set_onoff, -1), be_const_closure(Matter_Plugin_OnOff_set_onoff_closure) },
{ be_const_key_weak(ARG_TYPE, 10), be_const_static_closure(Matter_Plugin_OnOff__X3Clambda_X3E_closure) },
{ be_const_key_weak(tasmota_relay_index, 7), be_const_var(0) },
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(250) },
{ 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(266, -1), be_const_int(2) },
})) ) } )) },
{ be_const_key_weak(TYPE, 14), be_nested_str_weak(relay) },
{ be_const_key_weak(NAME, 1), be_nested_str_weak(Relay) },
{ be_const_key_weak(CLUSTERS, 11), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
@ -365,23 +404,10 @@ be_local_class(Matter_Plugin_OnOff,
be_const_int(65533),
})) ) } )) },
})) ) } )) },
{ be_const_key_weak(ARG, -1), be_nested_str_weak(relay) },
{ be_const_key_weak(UPDATE_TIME, 13), be_const_int(250) },
{ be_const_key_weak(TYPE, -1), be_nested_str_weak(relay) },
{ be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_OnOff_update_shadow_closure) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_OnOff_init_closure) },
{ be_const_key_weak(set_onoff, 12), be_const_closure(Matter_Plugin_OnOff_set_onoff_closure) },
{ be_const_key_weak(invoke_request, 4), be_const_closure(Matter_Plugin_OnOff_invoke_request_closure) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Relay) },
{ be_const_key_weak(tasmota_relay_index, -1), be_const_var(0) },
{ 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(266, -1), be_const_int(2) },
})) ) } )) },
{ be_const_key_weak(parse_configuration, 8), be_const_closure(Matter_Plugin_OnOff_parse_configuration_closure) },
{ be_const_key_weak(read_attribute, -1), be_const_closure(Matter_Plugin_OnOff_read_attribute_closure) },
{ be_const_key_weak(shadow_onoff, -1), be_const_var(1) },
{ be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(Matter_Plugin_OnOff__X3Clambda_X3E_closure) },
{ be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_OnOff_update_shadow_closure) },
})),
be_str_weak(Matter_Plugin_OnOff)
);

View File

@ -105,52 +105,43 @@ be_local_closure(Matter_Plugin_Sensor_parse_sensors, /* name */
/********************************************************************
** Solidified function: init
** Solidified function: parse_configuration
********************************************************************/
be_local_closure(Matter_Plugin_Sensor_init, /* name */
be_local_closure(Matter_Plugin_Sensor_parse_configuration, /* name */
be_nested_proto(
9, /* nstack */
4, /* argc */
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(tasmota_sensor_filter),
/* K2 */ be_nested_str_weak(find),
/* K3 */ be_nested_str_weak(ARG),
/* K4 */ be_nested_str_weak(tasmota_sensor_matcher),
/* K5 */ be_nested_str_weak(tasmota),
/* K6 */ be_nested_str_weak(Rule_Matcher),
/* K7 */ be_nested_str_weak(parse),
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota_sensor_filter),
/* K1 */ be_nested_str_weak(find),
/* K2 */ be_nested_str_weak(ARG),
/* K3 */ be_nested_str_weak(tasmota_sensor_matcher),
/* K4 */ be_nested_str_weak(tasmota),
/* K5 */ be_nested_str_weak(Rule_Matcher),
/* K6 */ be_nested_str_weak(parse),
}),
be_str_weak(init),
be_str_weak(parse_configuration),
&be_const_str_solidified,
( &(const binstruction[21]) { /* 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
0x8C100702, // 0008 GETMET R4 R3 K2
0x88180103, // 0009 GETMBR R6 R0 K3
0x7C100400, // 000A CALL R4 2
0x90020204, // 000B SETMBR R0 K1 R4
0x88100101, // 000C GETMBR R4 R0 K1
0x78120005, // 000D JMPF R4 #0014
0xB8120A00, // 000E GETNGBL R4 K5
0x88100906, // 000F GETMBR R4 R4 K6
0x8C100907, // 0010 GETMET R4 R4 K7
0x88180101, // 0011 GETMBR R6 R0 K1
0x7C100400, // 0012 CALL R4 2
0x90020804, // 0013 SETMBR R0 K4 R4
0x80000000, // 0014 RET 0
( &(const binstruction[13]) { /* code */
0x8C080301, // 0000 GETMET R2 R1 K1
0x88100102, // 0001 GETMBR R4 R0 K2
0x7C080400, // 0002 CALL R2 2
0x90020002, // 0003 SETMBR R0 K0 R2
0x88080100, // 0004 GETMBR R2 R0 K0
0x780A0005, // 0005 JMPF R2 #000C
0xB80A0800, // 0006 GETNGBL R2 K4
0x88080505, // 0007 GETMBR R2 R2 K5
0x8C080506, // 0008 GETMET R2 R2 K6
0x88100100, // 0009 GETMBR R4 R0 K0
0x7C080400, // 000A CALL R2 2
0x90020602, // 000B SETMBR R0 K3 R2
0x80000000, // 000C RET 0
})
)
);
@ -166,14 +157,14 @@ be_local_class(Matter_Plugin_Sensor,
&be_class_Matter_Plugin_Device,
be_nested_map(9,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(UPDATE_TIME, 3), be_const_int(5000) },
{ be_const_key_weak(ARG, 3), be_nested_str_weak(filter) },
{ be_const_key_weak(tasmota_sensor_filter, -1), be_const_var(0) },
{ be_const_key_weak(pre_value, -1), be_const_closure(Matter_Plugin_Sensor_pre_value_closure) },
{ be_const_key_weak(ARG, -1), be_nested_str_weak(filter) },
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(5000) },
{ be_const_key_weak(value_changed, -1), be_const_closure(Matter_Plugin_Sensor_value_changed_closure) },
{ be_const_key_weak(init, 7), be_const_closure(Matter_Plugin_Sensor_init_closure) },
{ be_const_key_weak(parse_sensors, 5), be_const_closure(Matter_Plugin_Sensor_parse_sensors_closure) },
{ be_const_key_weak(shadow_value, -1), be_const_var(2) },
{ be_const_key_weak(parse_sensors, 5), be_const_closure(Matter_Plugin_Sensor_parse_sensors_closure) },
{ be_const_key_weak(parse_configuration, -1), be_const_closure(Matter_Plugin_Sensor_parse_configuration_closure) },
{ be_const_key_weak(tasmota_sensor_matcher, -1), be_const_var(1) },
})),
be_str_weak(Matter_Plugin_Sensor)

View File

@ -7,49 +7,40 @@
extern const bclass be_class_Matter_Plugin_Sensor_Occupancy;
/********************************************************************
** Solidified function: init
** Solidified function: parse_configuration
********************************************************************/
be_local_closure(Matter_Plugin_Sensor_Occupancy_init, /* name */
be_local_closure(Matter_Plugin_Sensor_Occupancy_parse_configuration, /* name */
be_nested_proto(
9, /* nstack */
4, /* argc */
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(tasmota_switch_index),
/* K2 */ be_nested_str_weak(find),
/* K3 */ be_nested_str_weak(ARG),
/* K4 */ be_const_int(1),
/* K5 */ be_const_int(0),
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota_switch_index),
/* K1 */ be_nested_str_weak(find),
/* K2 */ be_nested_str_weak(ARG),
/* K3 */ be_const_int(1),
/* K4 */ be_const_int(0),
}),
be_str_weak(init),
be_str_weak(parse_configuration),
&be_const_str_solidified,
( &(const binstruction[20]) { /* 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
0x60100009, // 0008 GETGBL R4 G9
0x8C140702, // 0009 GETMET R5 R3 K2
0x881C0103, // 000A GETMBR R7 R0 K3
0x58200004, // 000B LDCONST R8 K4
0x7C140600, // 000C CALL R5 3
0x7C100200, // 000D CALL R4 1
0x90020204, // 000E SETMBR R0 K1 R4
0x88100101, // 000F GETMBR R4 R0 K1
0x18100905, // 0010 LE R4 R4 K5
0x78120000, // 0011 JMPF R4 #0013
0x90020304, // 0012 SETMBR R0 K1 K4
0x80000000, // 0013 RET 0
( &(const binstruction[12]) { /* code */
0x60080009, // 0000 GETGBL R2 G9
0x8C0C0301, // 0001 GETMET R3 R1 K1
0x88140102, // 0002 GETMBR R5 R0 K2
0x58180003, // 0003 LDCONST R6 K3
0x7C0C0600, // 0004 CALL R3 3
0x7C080200, // 0005 CALL R2 1
0x90020002, // 0006 SETMBR R0 K0 R2
0x88080100, // 0007 GETMBR R2 R0 K0
0x18080504, // 0008 LE R2 R2 K4
0x780A0000, // 0009 JMPF R2 #000B
0x90020103, // 000A SETMBR R0 K0 K3
0x80000000, // 000B RET 0
})
)
);
@ -283,18 +274,20 @@ be_local_class(Matter_Plugin_Sensor_Occupancy,
be_nested_map(12,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(5000) },
{ be_const_key_weak(TYPE, 9), be_nested_str_weak(occupancy) },
{ be_const_key_weak(parse_configuration, 9), be_const_closure(Matter_Plugin_Sensor_Occupancy_parse_configuration_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(263, -1), be_const_int(2) },
})) ) } )) },
{ be_const_key_weak(init, 11), be_const_closure(Matter_Plugin_Sensor_Occupancy_init_closure) },
{ be_const_key_weak(ARG, -1), be_nested_str_weak(switch) },
{ be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(Matter_Plugin_Sensor_Occupancy__X3Clambda_X3E_closure) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Occupancy) },
{ be_const_key_weak(read_attribute, 5), be_const_closure(Matter_Plugin_Sensor_Occupancy_read_attribute_closure) },
{ be_const_key_weak(shadow_occupancy, -1), be_const_var(1) },
{ be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
{ be_const_key_weak(tasmota_switch_index, -1), be_const_var(0) },
{ be_const_key_weak(TYPE, 11), be_nested_str_weak(occupancy) },
{ be_const_key_weak(CLUSTERS, 8), 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(1030, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
@ -308,8 +301,6 @@ be_local_class(Matter_Plugin_Sensor_Occupancy,
})) ) } )) },
})) ) } )) },
{ be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_Sensor_Occupancy_update_shadow_closure) },
{ be_const_key_weak(tasmota_switch_index, 8), be_const_var(0) },
{ be_const_key_weak(ARG, -1), be_nested_str_weak(switch) },
})),
be_str_weak(Matter_Plugin_Sensor_Occupancy)
);

View File

@ -6,6 +6,47 @@
extern const bclass be_class_Matter_Plugin_Sensor_OnOff;
/********************************************************************
** Solidified function: parse_configuration
********************************************************************/
be_local_closure(Matter_Plugin_Sensor_OnOff_parse_configuration, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota_switch_index),
/* K1 */ be_nested_str_weak(find),
/* K2 */ be_nested_str_weak(ARG),
/* K3 */ be_const_int(1),
/* K4 */ be_const_int(0),
}),
be_str_weak(parse_configuration),
&be_const_str_solidified,
( &(const binstruction[12]) { /* code */
0x60080009, // 0000 GETGBL R2 G9
0x8C0C0301, // 0001 GETMET R3 R1 K1
0x88140102, // 0002 GETMBR R5 R0 K2
0x58180003, // 0003 LDCONST R6 K3
0x7C0C0600, // 0004 CALL R3 3
0x7C080200, // 0005 CALL R2 1
0x90020002, // 0006 SETMBR R0 K0 R2
0x88080100, // 0007 GETMBR R2 R0 K0
0x18080504, // 0008 LE R2 R2 K4
0x780A0000, // 0009 JMPF R2 #000B
0x90020103, // 000A SETMBR R0 K0 K3
0x80000000, // 000B RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: <lambda>
********************************************************************/
@ -196,56 +237,6 @@ be_local_closure(Matter_Plugin_Sensor_OnOff_update_shadow, /* name */
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Matter_Plugin_Sensor_OnOff_init, /* name */
be_nested_proto(
9, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(tasmota_switch_index),
/* K2 */ be_nested_str_weak(find),
/* K3 */ be_nested_str_weak(ARG),
/* K4 */ be_const_int(1),
/* K5 */ be_const_int(0),
}),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[20]) { /* 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
0x60100009, // 0008 GETGBL R4 G9
0x8C140702, // 0009 GETMET R5 R3 K2
0x881C0103, // 000A GETMBR R7 R0 K3
0x58200004, // 000B LDCONST R8 K4
0x7C140600, // 000C CALL R5 3
0x7C100200, // 000D CALL R4 1
0x90020204, // 000E SETMBR R0 K1 R4
0x88100101, // 000F GETMBR R4 R0 K1
0x18100905, // 0010 LE R4 R4 K5
0x78120000, // 0011 JMPF R4 #0013
0x90020304, // 0012 SETMBR R0 K1 K4
0x80000000, // 0013 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Matter_Plugin_Sensor_OnOff
********************************************************************/
@ -256,19 +247,19 @@ be_local_class(Matter_Plugin_Sensor_OnOff,
be_nested_map(12,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(5000) },
{ be_const_key_weak(TYPE, 11), be_nested_str_weak(onoff) },
{ be_const_key_weak(parse_configuration, 8), be_const_closure(Matter_Plugin_Sensor_OnOff_parse_configuration_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(2128, -1), be_const_int(2) },
})) ) } )) },
{ be_const_key_weak(ARG, 9), be_nested_str_weak(switch) },
{ be_const_key_weak(ARG_TYPE, 8), be_const_static_closure(Matter_Plugin_Sensor_OnOff__X3Clambda_X3E_closure) },
{ be_const_key_weak(ARG, -1), be_nested_str_weak(switch) },
{ be_const_key_weak(ARG_TYPE, 9), be_const_static_closure(Matter_Plugin_Sensor_OnOff__X3Clambda_X3E_closure) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(OnOff) },
{ be_const_key_weak(read_attribute, 5), be_const_closure(Matter_Plugin_Sensor_OnOff_read_attribute_closure) },
{ be_const_key_weak(tasmota_switch_index, -1), be_const_var(0) },
{ be_const_key_weak(TYPE, 11), be_nested_str_weak(onoff) },
{ be_const_key_weak(shadow_onoff, -1), be_const_var(1) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Sensor_OnOff_init_closure) },
{ be_const_key_weak(CLUSTERS, 7), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {

View File

@ -573,49 +573,40 @@ be_local_closure(Matter_Plugin_Shutter_parse_sensors, /* name */
/********************************************************************
** Solidified function: init
** Solidified function: parse_configuration
********************************************************************/
be_local_closure(Matter_Plugin_Shutter_init, /* name */
be_local_closure(Matter_Plugin_Shutter_parse_configuration, /* name */
be_nested_proto(
9, /* nstack */
4, /* argc */
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(tasmota_shutter_index),
/* K2 */ be_nested_str_weak(find),
/* K3 */ be_nested_str_weak(ARG),
/* K4 */ be_const_int(0),
/* K5 */ be_nested_str_weak(shadow_shutter_inverted),
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_weak(tasmota_shutter_index),
/* K1 */ be_nested_str_weak(find),
/* K2 */ be_nested_str_weak(ARG),
/* K3 */ be_const_int(0),
/* K4 */ be_nested_str_weak(shadow_shutter_inverted),
}),
be_str_weak(init),
be_str_weak(parse_configuration),
&be_const_str_solidified,
( &(const binstruction[20]) { /* 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
0x8C100702, // 0008 GETMET R4 R3 K2
0x88180103, // 0009 GETMBR R6 R0 K3
0x7C100400, // 000A CALL R4 2
0x90020204, // 000B SETMBR R0 K1 R4
0x88100101, // 000C GETMBR R4 R0 K1
0x4C140000, // 000D LDNIL R5
0x1C100805, // 000E EQ R4 R4 R5
0x78120000, // 000F JMPF R4 #0011
0x90020304, // 0010 SETMBR R0 K1 K4
0x5411FFFE, // 0011 LDINT R4 -1
0x90020A04, // 0012 SETMBR R0 K5 R4
0x80000000, // 0013 RET 0
( &(const binstruction[12]) { /* code */
0x8C080301, // 0000 GETMET R2 R1 K1
0x88100102, // 0001 GETMBR R4 R0 K2
0x7C080400, // 0002 CALL R2 2
0x90020002, // 0003 SETMBR R0 K0 R2
0x88080100, // 0004 GETMBR R2 R0 K0
0x4C0C0000, // 0005 LDNIL R3
0x1C080403, // 0006 EQ R2 R2 R3
0x780A0000, // 0007 JMPF R2 #0009
0x90020103, // 0008 SETMBR R0 K0 K3
0x5409FFFE, // 0009 LDINT R2 -1
0x90020802, // 000A SETMBR R0 K4 R2
0x80000000, // 000B RET 0
})
)
);
@ -684,14 +675,14 @@ be_local_class(Matter_Plugin_Shutter,
&be_class_Matter_Plugin_Device,
be_nested_map(18,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(shadow_shutter_direction, -1), be_const_var(4) },
{ be_const_key_weak(shadow_shutter_tilt, -1), be_const_var(3) },
{ be_const_key_weak(TYPE, -1), be_nested_str_weak(shutter) },
{ 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(514, -1), be_const_int(2) },
})) ) } )) },
{ be_const_key_weak(update_shadow, -1), be_const_closure(Matter_Plugin_Shutter_update_shadow_closure) },
{ be_const_key_weak(update_shadow, 13), be_const_closure(Matter_Plugin_Shutter_update_shadow_closure) },
{ be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
@ -711,18 +702,18 @@ be_local_class(Matter_Plugin_Shutter,
})) ) } )) },
})) ) } )) },
{ be_const_key_weak(invoke_request, 14), be_const_closure(Matter_Plugin_Shutter_invoke_request_closure) },
{ be_const_key_weak(read_attribute, 13), be_const_closure(Matter_Plugin_Shutter_read_attribute_closure) },
{ be_const_key_weak(read_attribute, 16), be_const_closure(Matter_Plugin_Shutter_read_attribute_closure) },
{ be_const_key_weak(shadow_shutter_inverted, 3), be_const_var(5) },
{ be_const_key_weak(shadow_shutter_pos, -1), be_const_var(1) },
{ be_const_key_weak(ARG, -1), be_nested_str_weak(shutter) },
{ be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(Matter_Plugin_Shutter__X3Clambda_X3E_closure) },
{ be_const_key_weak(init, -1), be_const_closure(Matter_Plugin_Shutter_init_closure) },
{ be_const_key_weak(update_inverted, 16), be_const_closure(Matter_Plugin_Shutter_update_inverted_closure) },
{ be_const_key_weak(parse_sensors, -1), be_const_closure(Matter_Plugin_Shutter_parse_sensors_closure) },
{ be_const_key_weak(shadow_shutter_target, -1), be_const_var(2) },
{ be_const_key_weak(tasmota_shutter_index, 11), be_const_var(0) },
{ be_const_key_weak(NAME, -1), be_nested_str_weak(Shutter) },
{ be_const_key_weak(shadow_shutter_tilt, 0), be_const_var(3) },
{ be_const_key_weak(update_inverted, 11), be_const_closure(Matter_Plugin_Shutter_update_inverted_closure) },
{ be_const_key_weak(parse_configuration, -1), be_const_closure(Matter_Plugin_Shutter_parse_configuration_closure) },
{ be_const_key_weak(shadow_shutter_target, -1), be_const_var(2) },
{ be_const_key_weak(tasmota_shutter_index, -1), be_const_var(0) },
{ be_const_key_weak(parse_sensors, -1), be_const_closure(Matter_Plugin_Shutter_parse_sensors_closure) },
{ be_const_key_weak(shadow_shutter_direction, 0), be_const_var(4) },
})),
be_str_weak(Matter_Plugin_Shutter)
);

File diff suppressed because it is too large Load Diff