tweak
This commit is contained in:
parent
72d131721b
commit
ffb12e5098
|
@ -257,12 +257,20 @@ namespace ratgdo {
|
|||
printRollingCode();
|
||||
|
||||
if (command != Commands::DOOR1) { // door2 is created with same counter and should always be called after door1
|
||||
ESP_LOGD(TAG, "Incrementing rolling code counter");
|
||||
this->rollingCodeCounter = (this->rollingCodeCounter + 1) & 0xfffffff;
|
||||
incrementRollingCodeCounter();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void RATGDOComponent::incrementRollingCodeCounter()
|
||||
{
|
||||
ESP_LOGD(TAG, "Incrementing rolling code counter");
|
||||
this->rollingCodeCounter = (this->rollingCodeCounter + 1) & 0xfffffff;
|
||||
for (auto* child : this->children_) {
|
||||
child->on_rolling_code_change(this->rollingCodeCounter);
|
||||
}
|
||||
}
|
||||
|
||||
void RATGDOComponent::printRollingCode()
|
||||
{
|
||||
ESP_LOGD(TAG, "Counter: %d Send code: [%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X]",
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace ratgdo {
|
|||
void RATGDOClient::on_lock_state(LockState state) {};
|
||||
void RATGDOClient::on_motion_state(MotionState state) {};
|
||||
void RATGDOClient::on_obstruction_state(ObstructionState state) {};
|
||||
void RATGDOClient::on_rolling_code_change(uint32_t rollingCodeCounter) {};
|
||||
|
||||
} // namespace ratgdo
|
||||
} // namespace esphome
|
||||
|
|
|
@ -18,6 +18,7 @@ namespace ratgdo {
|
|||
virtual void on_lock_state(LockState state);
|
||||
virtual void on_motion_state(MotionState state);
|
||||
virtual void on_obstruction_state(ObstructionState state);
|
||||
virtual void on_rolling_code_change(uint32_t rollingCodeCounter);
|
||||
|
||||
protected:
|
||||
friend RATGDOComponent;
|
||||
|
|
Loading…
Reference in New Issue