mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2026-04-06 01:03:45 +02:00
Fix: Set all settings to default when deleting an inverters
Previously some old settings from previous inverters could have been shown in a new inverter
This commit is contained in:
@@ -406,4 +406,26 @@ INVERTER_CONFIG_T* ConfigurationClass::getInverterConfig(const uint64_t serial)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ConfigurationClass::deleteInverterById(const uint8_t id)
|
||||
{
|
||||
config.Inverter[id].Serial = 0ULL;
|
||||
strlcpy(config.Inverter[id].Name, "", sizeof(config.Inverter[id].Name));
|
||||
config.Inverter[id].Order = 0;
|
||||
|
||||
config.Inverter[id].Poll_Enable = true;
|
||||
config.Inverter[id].Poll_Enable_Night = true;
|
||||
config.Inverter[id].Command_Enable = true;
|
||||
config.Inverter[id].Command_Enable_Night = true;
|
||||
config.Inverter[id].ReachableThreshold = REACHABLE_THRESHOLD;
|
||||
config.Inverter[id].ZeroRuntimeDataIfUnrechable = false;
|
||||
config.Inverter[id].ZeroYieldDayOnMidnight = false;
|
||||
config.Inverter[id].YieldDayCorrection = false;
|
||||
|
||||
for (uint8_t c = 0; c < INV_MAX_CHAN_COUNT; c++) {
|
||||
config.Inverter[id].channel[c].MaxChannelPower = 0;
|
||||
config.Inverter[id].channel[c].YieldTotalOffset = 0.0f;
|
||||
strlcpy(config.Inverter[id].channel[c].Name, "", sizeof(config.Inverter[id].channel[c].Name));
|
||||
}
|
||||
}
|
||||
|
||||
ConfigurationClass Configuration;
|
||||
|
||||
Reference in New Issue
Block a user