diff --git a/components/secplus_gdo/secplus_gdo.cpp b/components/secplus_gdo/secplus_gdo.cpp index 18492ff..7b8795b 100644 --- a/components/secplus_gdo/secplus_gdo.cpp +++ b/components/secplus_gdo/secplus_gdo.cpp @@ -32,8 +32,11 @@ namespace secplus_gdo { ESP_LOGI(TAG, "Synced: %s, protocol: %s", status->synced ? "true" : "false", gdo_protocol_type_to_string(status->protocol)); if (status->protocol == GDO_PROTOCOL_SEC_PLUS_V2) { ESP_LOGI(TAG, "Client ID: %" PRIu32 ", Rolling code: %" PRIu32, status->client_id, status->rolling_code); - gdo->set_client_id(status->client_id); - gdo->set_rolling_code(status->rolling_code); + if (status->synced) { + // Save the last successful ClientID rolling code value to NVS for use on reboot + gdo->set_client_id(status->client_id); + gdo->set_rolling_code(status->rolling_code); + } } if (!status->synced) {