Skip to content

Commit

Permalink
Merge branch 'pr1676' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Jan 26, 2024
2 parents 4e669d8 + 7aece2e commit f0061b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/InverterSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void InverterSettingsClass::init(Scheduler& scheduler)
void InverterSettingsClass::settingsLoop()
{
const CONFIG_T& config = Configuration.get();
const bool isDayPeriod = SunPosition.isDayPeriod();

for (uint8_t i = 0; i < INV_MAX_COUNT; i++) {
auto const& inv_cfg = config.Inverter[i];
Expand All @@ -117,8 +118,8 @@ void InverterSettingsClass::settingsLoop()
continue;
}

inv->setEnablePolling(inv_cfg.Poll_Enable && (SunPosition.isDayPeriod() || inv_cfg.Poll_Enable_Night));
inv->setEnableCommands(inv_cfg.Command_Enable && (SunPosition.isDayPeriod() || inv_cfg.Command_Enable_Night));
inv->setEnablePolling(inv_cfg.Poll_Enable && (isDayPeriod || inv_cfg.Poll_Enable_Night));
inv->setEnableCommands(inv_cfg.Command_Enable && (isDayPeriod || inv_cfg.Command_Enable_Night));
}
}

Expand Down

0 comments on commit f0061b9

Please sign in to comment.