mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 22:02:17 +01:00
fix: swap restored radio config under the radio lock
Restoring a backup wrote the transceiver config in place from the async task while the radio task could be transmitting with it. Read the record into a copy and swap it in through the new Transceiver::setConfig, which Transceiver::fromJSON now uses as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
352f36e478
commit
00a084048f
3 changed files with 15 additions and 7 deletions
|
|
@ -608,7 +608,10 @@ bool ShadeConfigFile::restoreFile(SomfyShadeController *s, const char *filename,
|
|||
if(opts.shades) s->commit();
|
||||
if(opts.transceiver)
|
||||
{
|
||||
this->readTransRecord(s->transceiver.config);
|
||||
// Read into a copy so the radio task never transmits on a half restored config.
|
||||
transceiver_config_t cfg = s->transceiver.config;
|
||||
this->readTransRecord(cfg);
|
||||
s->transceiver.setConfig(cfg);
|
||||
s->transceiver.save();
|
||||
}
|
||||
if(opts.settings || opts.network) settings.save();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue