Skip to content

Commit

Permalink
Matter fix when Rules are disabled (#22016)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger authored Aug 25, 2024
1 parent 645ce4a commit 8d6a4bd
Show file tree
Hide file tree
Showing 3 changed files with 2,243 additions and 2,308 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
27 changes: 11 additions & 16 deletions lib/libesp32/berry_matter/src/embedded/Matter_zz_Device.be
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 8d6a4bd

Please sign in to comment.