From 0f81c2198334951ed73fb1fd3c4211fc51bbf5de Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 5 Jun 2023 19:21:59 -0500 Subject: [PATCH] fix --- components/ratgdo/ratgdo.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index 855f0e2..fc7f9b0 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -471,12 +471,9 @@ namespace ratgdo { { getRollingCode("door1"); transmit(this->txRollingCode); - delay(40); - getRollingCode("door2"); transmit(this->txRollingCode); - this->pref_.save(&this->rollingCodeCounter); } @@ -498,9 +495,7 @@ namespace ratgdo { } void RATGDOComponent::toggleLight(){ - getRollingCode("light"); - transmit(this->txRollingCode); - this->pref_.save(&this->rollingCodeCounter); + sendCommand("light"); } // Lock functions @@ -521,7 +516,11 @@ namespace ratgdo { } void RATGDOComponent::toggleLock(){ - getRollingCode("lock"); + sendCommand("lock"); + } + + void RATGDOComponent::sendCommand(const char* command){ + getRollingCode(command); transmit(this->txRollingCode); this->pref_.save(&this->rollingCodeCounter); }