Matter allow Matter#Initialized rule once the device is configured (#18451)

This commit is contained in:
s-hadinger 2023-04-18 22:27:27 +02:00 committed by GitHub
parent fb98d8954a
commit a85412fce2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3258 additions and 3115 deletions

View File

@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
### Added ### Added
- Matter sensors Humidity, Pressure, Illuminance; optimize memory (#18441) - Matter sensors Humidity, Pressure, Illuminance; optimize memory (#18441)
- Command ``SetOption152 0/1`` to select two (default) or one pin bistable relay control (#18386) - Command ``SetOption152 0/1`` to select two (default) or one pin bistable relay control (#18386)
- Matter allow `Matter#Initialized` rule once the device is configured
### Breaking Changed ### Breaking Changed

View File

@ -104,6 +104,8 @@ class Matter_Device
self._init_basic_commissioning() self._init_basic_commissioning()
tasmota.add_driver(self) tasmota.add_driver(self)
self.register_commands()
end end
############################################################# #############################################################
@ -1011,7 +1013,7 @@ class Matter_Device
end end
if endpoint > 0x40 break end if endpoint > 0x40 break end
end end
tasmota.publish_result('{"Matter":{"Initialized":1}}', 'Matter')
end end
# get keys of a map in sorted order # get keys of a map in sorted order
@ -1019,6 +1021,30 @@ class Matter_Device
for i:1..size(l)-1 var k = l[i] var j = i while (j > 0) && (l[j-1] > k) l[j] = l[j-1] j -= 1 end l[j] = k end return l for i:1..size(l)-1 var k = l[i] var j = i while (j > 0) && (l[j-1] > k) l[j] = l[j-1] j -= 1 end l[j] = k end return l
end end
#####################################################################
# Commands `Mtr___`
#####################################################################
#
def register_commands()
tasmota.add_cmd("MtrJoin", /cmd_found, idx, payload, payload_json -> self.MtrJoin(cmd_found, idx, payload, payload_json))
end
#####################################################################
# `MtrJoin`
#
# Open or close commissioning
#
def MtrJoin(cmd_found, idx, payload, payload_json)
var payload_int = int(payload)
if payload_int
self.start_root_basic_commissioning()
else
self.stop_basic_commissioning()
end
tasmota.resp_cmnd_done()
end
end end
matter.Device = Matter_Device matter.Device = Matter_Device