button
This commit is contained in:
parent
a66b446103
commit
53d9c62732
|
@ -477,7 +477,10 @@ namespace ratgdo {
|
||||||
{
|
{
|
||||||
transmit(command);
|
transmit(command);
|
||||||
this->pref_.save(&this->rollingCodeCounter);
|
this->pref_.save(&this->rollingCodeCounter);
|
||||||
global_preferences->sync();
|
if (!this->lastSyncedRollingCodeCounter || this->rollingCodeCounter - this->lastSyncedRollingCodeCounter > 2) {
|
||||||
|
this->lastSyncedRollingCodeCounter = this->rollingCodeCounter;
|
||||||
|
global_preferences->sync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RATGDOComponent::register_child(RATGDOClient* obj)
|
void RATGDOComponent::register_child(RATGDOClient* obj)
|
||||||
|
|
|
@ -82,9 +82,11 @@ namespace ratgdo {
|
||||||
void loop() override;
|
void loop() override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
|
||||||
uint32_t rollingCodeCounter;
|
uint32_t rollingCodeCounter{ 0};
|
||||||
|
uint32_t lastSyncedRollingCodeCounter{ 0};
|
||||||
|
|
||||||
uint16_t previousOpenings { 0 }; // number of times the door has been opened
|
uint16_t previousOpenings { 0 }; // number of times the door has been opened
|
||||||
uint16_t openings; // number of times the door has been opened
|
uint16_t openings{0}; // number of times the door has been opened
|
||||||
|
|
||||||
uint8_t txRollingCode[CODE_LENGTH];
|
uint8_t txRollingCode[CODE_LENGTH];
|
||||||
uint8_t rxRollingCode[CODE_LENGTH];
|
uint8_t rxRollingCode[CODE_LENGTH];
|
||||||
|
|
Loading…
Reference in New Issue