only publish config and battery state if successfully queried
This commit is contained in:
@@ -304,8 +304,11 @@ void NukiWrapper::updateKeyTurnerState()
|
||||
|
||||
void NukiWrapper::updateBatteryState()
|
||||
{
|
||||
_nukiLock.requestBatteryReport(&_batteryReport);
|
||||
_network->publishBatteryReport(_batteryReport);
|
||||
Nuki::CmdResult result = _nukiLock.requestBatteryReport(&_batteryReport);
|
||||
if(result == Nuki::CmdResult::Success)
|
||||
{
|
||||
_network->publishBatteryReport(_batteryReport);
|
||||
}
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
@@ -315,8 +318,14 @@ void NukiWrapper::updateConfig()
|
||||
readAdvancedConfig();
|
||||
_configRead = true;
|
||||
_hasKeypad = _nukiConfig.hasKeypad > 0;
|
||||
_network->publishConfig(_nukiConfig);
|
||||
_network->publishAdvancedConfig(_nukiAdvancedConfig);
|
||||
if(_nukiConfigValid)
|
||||
{
|
||||
_network->publishConfig(_nukiConfig);
|
||||
}
|
||||
if(_nukiAdvancedConfigValid)
|
||||
{
|
||||
_network->publishAdvancedConfig(_nukiAdvancedConfig);
|
||||
}
|
||||
}
|
||||
|
||||
void NukiWrapper::updateAuthData()
|
||||
|
||||
Reference in New Issue
Block a user