publish first config values via mqtt

This commit is contained in:
technyon
2022-04-09 13:20:53 +02:00
parent 1ac49cc2c3
commit 3111c59e0b
5 changed files with 62 additions and 11 deletions

View File

@@ -26,6 +26,9 @@ private:
void updateKeyTurnerState();
void updateBatteryState();
void updateConfig();
void readConfig();
Nuki::LockAction lockActionToEnum(const char* str); // char array at least 14 characters
@@ -36,6 +39,7 @@ private:
Preferences* _preferences;
int _intervalLockstate = 0; // seconds
int _intervalBattery = 0; // seconds
int _intervalConfig = 60 * 60; // seconds
Nuki::KeyTurnerState _lastKeyTurnerState;
Nuki::KeyTurnerState _keyTurnerState;
@@ -43,10 +47,14 @@ private:
Nuki::BatteryReport _batteryReport;
Nuki::BatteryReport _lastBatteryReport;
Nuki::Config _nukiConfig = {0};
bool _nukiConfigValid = false;
bool _paired = false;
bool _statusUpdated = false;
unsigned long _nextLockStateUpdateTs = 0;
unsigned long _nextBatteryReportTs = 0;
unsigned long _nextConfigUpdateTs = 0;
unsigned long _nextPairTs = 0;
Nuki::LockAction _nextLockAction = (Nuki::LockAction)0xff;
};