fix
This commit is contained in:
parent
f334b186b6
commit
dc1b03ec64
|
@ -474,7 +474,7 @@ namespace ratgdo {
|
||||||
|
|
||||||
void RATGDOComponent::openDoor()
|
void RATGDOComponent::openDoor()
|
||||||
{
|
{
|
||||||
if (this->doorState == "open" || this->doorState == "opening") {
|
if(this->doorStates[this->store_.doorState] == "open" || doorStates[this->store_.doorState] == "opening"){
|
||||||
ESP_LOGD(TAG, "The door is already %s", doorState);
|
ESP_LOGD(TAG, "The door is already %s", doorState);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -488,7 +488,7 @@ namespace ratgdo {
|
||||||
|
|
||||||
void RATGDOComponent::closeDoor()
|
void RATGDOComponent::closeDoor()
|
||||||
{
|
{
|
||||||
if (this->doorState == "closed" || this->doorState == "closing") {
|
if(this->doorStates[this->store_.doorState] == "closed" || doorStates[this->store_.doorState] == "closing"){
|
||||||
ESP_LOGD(TAG, "The door is already %s", this->doorState);
|
ESP_LOGD(TAG, "The door is already %s", this->doorState);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -501,7 +501,7 @@ namespace ratgdo {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RATGDOComponent::stopDoor(){
|
void RATGDOComponent::stopDoor(){
|
||||||
if(doorStates[doorState] == "opening" || doorStates[doorState] == "closing"){
|
if(this->doorStates[this->store_.doorState] == "opening" || doorStates[this->store_.doorState] == "closing"){
|
||||||
toggleDoor();
|
toggleDoor();
|
||||||
}else{
|
}else{
|
||||||
Serial.print("The door is not moving.");
|
Serial.print("The door is not moving.");
|
||||||
|
@ -512,12 +512,12 @@ namespace ratgdo {
|
||||||
{
|
{
|
||||||
if (this->useRollingCodes_) {
|
if (this->useRollingCodes_) {
|
||||||
getRollingCode("door1");
|
getRollingCode("door1");
|
||||||
transmit(this->rollingCode);
|
transmit(this->txRollingCode);
|
||||||
|
|
||||||
delay(40);
|
delay(40);
|
||||||
|
|
||||||
getRollingCode("door2");
|
getRollingCode("door2");
|
||||||
transmit(this->rollingCode);
|
transmit(this->txRollingCode);
|
||||||
|
|
||||||
this->pref_.save(&this->rollingCodeCounter);
|
this->pref_.save(&this->rollingCodeCounter);
|
||||||
} else {
|
} else {
|
||||||
|
@ -531,7 +531,7 @@ namespace ratgdo {
|
||||||
{
|
{
|
||||||
if (this->useRollingCodes_) {
|
if (this->useRollingCodes_) {
|
||||||
getRollingCode("light");
|
getRollingCode("light");
|
||||||
transmit(this->rollingCode);
|
transmit(this->txRollingCode);
|
||||||
this->pref_.save(&this->rollingCodeCounter);
|
this->pref_.save(&this->rollingCodeCounter);
|
||||||
} else {
|
} else {
|
||||||
sendSyncCodes();
|
sendSyncCodes();
|
||||||
|
|
Loading…
Reference in New Issue