mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-25 20:06:08 +00:00
Clear HA config in next config version
This commit is contained in:
@@ -336,7 +336,6 @@ bool AmsConfiguration::getHomeAssistantConfig(HomeAssistantConfig& config) {
|
||||
if(hasConfig()) {
|
||||
EEPROM.begin(EEPROM_SIZE);
|
||||
EEPROM.get(CONFIG_HA_START, config);
|
||||
if(config.tag != 0xA7) clearHomeAssistantConfig(config);
|
||||
EEPROM.end();
|
||||
return true;
|
||||
} else {
|
||||
@@ -367,7 +366,6 @@ bool AmsConfiguration::setHomeAssistantConfig(HomeAssistantConfig& config) {
|
||||
}
|
||||
|
||||
void AmsConfiguration::clearHomeAssistantConfig(HomeAssistantConfig& config) {
|
||||
config.tag = 0xA7;
|
||||
strcpy(config.discoveryPrefix, "");
|
||||
strcpy(config.discoveryHostname, "");
|
||||
strcpy(config.discoveryNameTag, "");
|
||||
@@ -1035,6 +1033,10 @@ bool AmsConfiguration::relocateConfig102() {
|
||||
gpioConfig.hanPinPullup = true;
|
||||
EEPROM.put(CONFIG_GPIO_START, gpioConfig);
|
||||
|
||||
HomeAssistantConfig haconf;
|
||||
clearHomeAssistantConfig(haconf);
|
||||
EEPROM.put(CONFIG_HA_START, haconf);
|
||||
|
||||
EEPROM.put(EEPROM_CONFIG_ADDRESS, 103);
|
||||
bool ret = EEPROM.commit();
|
||||
EEPROM.end();
|
||||
|
||||
Reference in New Issue
Block a user