Skip to content

Commit

Permalink
fix initalizing preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
technyon committed Feb 5, 2023
1 parent ff62368 commit 4502271
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#define NUKI_HUB_VERSION "8.4"
#define NUKI_HUB_VERSION "8.5"

#define MQTT_QOS_LEVEL 1
#define MQTT_CLEAN_SESSIONS false
31 changes: 31 additions & 0 deletions NukiWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,37 @@ void NukiWrapper::initialize(const bool& firstStart)
_preferences->putInt(preference_command_retry_delay, 1000);
}

if(_retryDelay <= 100)
{
_retryDelay = 100;
_preferences->putInt(preference_command_retry_delay, _retryDelay);
}

if(_intervalLockstate == 0)
{
_intervalLockstate = 60 * 30;
_preferences->putInt(preference_query_interval_lockstate, _intervalLockstate);
}
if(_intervalConfig == 0)
{
_intervalConfig = 60 * 60;
_preferences->putInt(preference_query_interval_configuration, _intervalConfig);
}
if(_intervalBattery == 0)
{
_intervalBattery = 60 * 30;
_preferences->putInt(preference_query_interval_battery, _intervalBattery);
}
if(_intervalKeypad == 0)
{
_intervalKeypad = 60 * 30;
_preferences->putInt(preference_query_interval_keypad, _intervalKeypad);
}
if(_restartBeaconTimeout < 10)
{
_restartBeaconTimeout = -1;
_preferences->putInt(preference_restart_ble_beacon_lost, _restartBeaconTimeout);
}

_nukiLock.setEventHandler(this);

Expand Down
Binary file modified webflash/nuki_hub.bin
Binary file not shown.

0 comments on commit 4502271

Please sign in to comment.