parent
811f6d3e25
commit
f3fb14d421
|
@ -190,8 +190,8 @@ namespace ratgdo {
|
||||||
} else if (cmd == 0x281) {
|
} else if (cmd == 0x281) {
|
||||||
light ^= 1; // toggle bit
|
light ^= 1; // toggle bit
|
||||||
ESP_LOGD(TAG, "Light: %d (toggle)", light);
|
ESP_LOGD(TAG, "Light: %d (toggle)", light);
|
||||||
|
|
||||||
} else if (cmd == 0x84) {
|
} else if (cmd == 0x84) {
|
||||||
|
ESP_LOGD(TAG, "Unknown 0x84");
|
||||||
} else if (cmd == 0x280) {
|
} else if (cmd == 0x280) {
|
||||||
ESP_LOGD(TAG, "Pressed: %s", byte1 == 1 ? "pressed" : "released");
|
ESP_LOGD(TAG, "Pressed: %s", byte1 == 1 ? "pressed" : "released");
|
||||||
} else if (cmd == 0x48c) {
|
} else if (cmd == 0x48c) {
|
||||||
|
@ -585,6 +585,9 @@ namespace ratgdo {
|
||||||
ESP_LOGD(TAG, "The light is already on");
|
ESP_LOGD(TAG, "The light is already on");
|
||||||
} else {
|
} else {
|
||||||
toggleLight();
|
toggleLight();
|
||||||
|
// We don't always get the state back so be optimistic
|
||||||
|
this->previousLightState = this->lightState;
|
||||||
|
this->lightState = LightState::LIGHT_STATE_ON;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -594,6 +597,9 @@ namespace ratgdo {
|
||||||
ESP_LOGD(TAG, "The light is already off");
|
ESP_LOGD(TAG, "The light is already off");
|
||||||
} else {
|
} else {
|
||||||
toggleLight();
|
toggleLight();
|
||||||
|
// We don't always get the state back so be optimistic
|
||||||
|
this->previousLightState = this->lightState;
|
||||||
|
this->lightState = LightState::LIGHT_STATE_OFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue