Matter fix when Rules are disabled (#22016)

This commit is contained in:
s-hadinger 2024-08-25 19:33:40 +02:00 committed by GitHub
parent 645ce4a1ee
commit 8d6a4bd7be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2812 additions and 2877 deletions

View File

@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- Matter fixed UI bug when no endpoints configured
- Zigbee extend timeout for MCU reboot from 5s to 10s
- Matter fix when Rules are disabled
### Removed

View File

@ -84,28 +84,22 @@ class Matter_Device
self.events = matter.EventHandler(self)
self.ui = matter.UI(self)
if tasmota.wifi()['up'] || tasmota.eth()['up']
self.start()
end
if !tasmota.wifi()['up']
tasmota.add_rule("Wifi#Connected", def ()
self.start()
tasmota.remove_rule("Wifi#Connected", "matter_start")
end, "matter_start")
end
if !tasmota.eth()['up']
tasmota.add_rule("Eth#Connected", def ()
self.start()
tasmota.remove_rule("Eth#Connected", "matter_start")
end, "matter_start")
end
self.commissioning.init_basic_commissioning()
tasmota.add_driver(self)
self.register_commands()
end
#############################################################
# Check if the network just started
def check_network()
if self.started return end # abort if already started
if tasmota.wifi()['up'] || tasmota.eth()['up']
self.start()
end
end
#############################################################
# Start Matter device server when the first network is coming up
def start()
@ -255,6 +249,7 @@ class Matter_Device
# dispatch every 50ms
# ticks
def every_50ms()
self.check_network()
self.tick += 1
self.message_handler.every_50ms()
end