Throttle 0x38 command insertion for 0x37 openers to 10s

This commit is contained in:
Marius Muja 2024-01-12 23:28:13 -08:00
parent 1fdcd8f8b7
commit 8ced427141
2 changed files with 5 additions and 6 deletions

View File

@ -313,7 +313,10 @@ namespace secplus1 {
this->is_0x37_panel_ = true;
if (!this->do_transmit_if_pending()) {
// inject door status request
if (millis() - this->last_status_query_ > 10000) {
this->transmit_byte(static_cast<uint8_t>(CommandType::DOOR_STATUS), true);
this->last_status_query_ = millis();
}
}
} else if (cmd.req == CommandType::OTHER_STATUS) {
LightState light_state = to_LightState((cmd.resp >> 2) & 1, LightState::UNKNOWN);

View File

@ -114,12 +114,8 @@ namespace secplus1 {
bool is_0x37_panel_ { false };
std::priority_queue<TxCommand, std::vector<TxCommand>, FirstToSend> pending_tx_;
// bool transmit_pending_ { false };
// uint32_t transmit_pending_start_ { 0 };
TxPacket tx_packet_;
uint32_t last_rx_ { 0 };
uint32_t last_status_query_ { 0 };
SoftwareSerial sw_serial_;