Possibility to specify fixed energy price

This commit is contained in:
Gunnar Skjold
2023-04-01 10:57:21 +02:00
parent ea43b2b632
commit 700f023292
14 changed files with 118 additions and 78 deletions

View File

@@ -551,6 +551,7 @@ bool AmsConfiguration::setEntsoeConfig(EntsoeConfig& config) {
entsoeChanged |= strcmp(config.currency, existing.currency) != 0;
entsoeChanged |= config.multiplier != existing.multiplier;
entsoeChanged |= config.enabled != existing.enabled;
entsoeChanged |= config.fixedPrice != existing.fixedPrice;
} else {
entsoeChanged = true;
}
@@ -1037,6 +1038,11 @@ bool AmsConfiguration::relocateConfig102() {
clearHomeAssistantConfig(haconf);
EEPROM.put(CONFIG_HA_START, haconf);
EntsoeConfig entsoe;
EEPROM.get(CONFIG_ENTSOE_START, entsoe);
entsoe.fixedPrice = 0;
EEPROM.put(CONFIG_ENTSOE_START, entsoe);
EEPROM.put(EEPROM_CONFIG_ADDRESS, 103);
bool ret = EEPROM.commit();
EEPROM.end();