Skip to content

Commit

Permalink
Only save Client ID and Rolling code when sync is succeeds.
Browse files Browse the repository at this point in the history
  • Loading branch information
h2zero committed Jul 7, 2024
1 parent b539efc commit 30623b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/secplus_gdo/secplus_gdo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 30623b4

Please sign in to comment.