From 799c1ee9c9ce74c6ce51ba069c796d2bd86b9dd8 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 5 Jun 2023 13:50:34 -0500 Subject: [PATCH] fix --- components/ratgdo/ratgdo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index b5f6099..8b09268 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -445,7 +445,7 @@ void RATGDOComponent::closeDoor() { getRollingCode("door2"); transmit(this->rollingCode, CODE_LENGTH); - writeCounterToFlash(); + this->pref_.save(&this->rollingCodeCounter); } else { for (int i = 0; i < 4; i++) { ESP_LOGD(TAG, "sync_code[%d]", i); @@ -462,7 +462,7 @@ void RATGDOComponent::toggleLight() { if (this->useRollingCodes) { getRollingCode("light"); transmit(this->rollingCode, CODE_LENGTH); - writeCounterToFlash(); + this->pref_.save(&this->rollingCodeCounter); } else { for (int i = 0; i < 4; i++) { ESP_LOGD(TAG, "sync_code[%d]", i);