Refactor retry handling (#702)

* add NukiRetryHandler

* apply retry wrapper to opener wrapper

* apply retry wrapper to all opener communication

* apply retry wrapper to all lock communication

* remove commented out code

* replace millis() with espMillis() in wrapper classes
This commit is contained in:
Jan-Ole Schümann
2025-10-05 21:12:29 +07:00
committed by GitHub
parent 778d73cd58
commit e05ff0fdd0
9 changed files with 214 additions and 329 deletions

View File

@@ -10,6 +10,7 @@
#include "NukiDeviceId.h"
#include "NukiOfficial.h"
#include "EspMillis.h"
#include "util/NukiRetryHandler.h"
class NukiWrapper : public Nuki::SmartlockEventHandler
{
@@ -48,7 +49,6 @@ public:
const std::string firmwareVersion() const;
const std::string hardwareVersion() const;
void setCommErrorPins(const uint8_t& value);
void notify(Nuki::EventType eventType) override;
@@ -93,8 +93,7 @@ private:
NukiNetworkLock* _network = nullptr;
NukiOfficial* _nukiOfficial = nullptr;
Gpio* _gpio = nullptr;
std::vector<uint8_t> _pinsCommError;
NukiRetryHandler* _nukiRetryHandler = nullptr;
Preferences* _preferences;
int _intervalLockstate = 0; // seconds