detect key turner state updates via scanning advertisements

This commit is contained in:
technyon
2022-03-31 17:41:25 +02:00
parent 9279257ce9
commit f3de3c75df
4 changed files with 22 additions and 6 deletions

5
Nuki.h
View File

@@ -4,7 +4,7 @@
#include "NukiConstants.h"
#include "Network.h"
class Nuki
class Nuki : public NukiSmartlockEventHandler
{
public:
Nuki(const std::string& name, uint32_t id, Network* network, Preferences* preferences);
@@ -14,6 +14,8 @@ public:
const bool isPaired();
void notify(NukiEventType eventType) override;
private:
static void onLockActionReceived(const char* value);
@@ -39,6 +41,7 @@ private:
BatteryReport _lastBatteryReport;
bool _paired = false;
bool _statusUpdated = false;
unsigned long _nextLockStateUpdateTs = 0;
unsigned long _nextBatteryReportTs = 0;
LockAction _nextLockAction = (LockAction)0xff;