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