Conversation
- support sync mode at boot, apply based on specific ID change default to the last relay ID for setting status (set as build flag / setting otherwise) - retain hw gpio relay status when rebooting - relays keep timers in a shared pool mqtt disconnect, pulse & on / off delay cannot overlap - some api calls try to avoid relays that were not boot'ed yet processing must happen at least once for it to begin working
There was a problem hiding this comment.
Pull request overview
This PR refactors the relay boot and synchronization system to introduce shared timer management, improved boot sequence handling, and enhanced sync mode capabilities. The changes aim to unify timer handling across different relay operations and improve relay state retention across reboots.
- Introduces a shared timer pool (
BulkTimer) that manages MQTT disconnect, pulse, and on/off delay timers to prevent overlapping operations - Adds sync mode ID configuration to control which relay drives synchronization behavior during boot
- Implements relay status retention for GPIO-based relays across reboots using hardware state
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| code/espurna/thermostat.cpp | Simplified relayStatus() call by removing explicit forward and group report parameters |
| code/espurna/relay.h | Updated API signatures, removed overloaded functions, added relayTimer() and improved documentation |
| code/espurna/relay.cpp | Major refactoring including timer pool implementation, boot sequence changes, sync logic improvements, and relay activation tracking |
| code/espurna/config/general.h | Added RELAY_SYNC_ID, RELAY_DELAY_ON, and RELAY_DELAY_OFF configuration options |
| code/espurna/config/defaults.h | Updated relay delay defaults to use global RELAY_DELAY_ON/OFF settings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
previously retrieving 'last relay #'
amends de8cb76 clean up cancelation logic & fix notifier also be more diligent when discovering sync func prefer using sync mask for delayed timers, but keep id for pulse
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fix 32 -> 8 size assumption & generate bulk request immediately just a guess, though. no idea how real hw would work here
by default, last relay boot'ed is used for status.