Merge branch 'technyon:master' into update-wifimanager

This commit is contained in:
iranl
2024-05-15 19:11:36 +02:00
committed by GitHub
23 changed files with 334 additions and 56 deletions

View File

@@ -470,7 +470,7 @@ void NukiOpenerWrapper::updateConfig()
void NukiOpenerWrapper::updateAuthData()
{
if(_nukiOpener.getSecurityPincode() == 0) return;
if(!isPinSet()) return;
Nuki::CmdResult result = _nukiOpener.retrieveLogEntries(0, 0, 0, true);
if(result != Nuki::CmdResult::Success)
@@ -768,10 +768,19 @@ Nuki::BatteryType NukiOpenerWrapper::batteryTypeToEnum(const char* str)
void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
{
JsonDocument jsonResult;
char _resbuf[2048];
if(_nukiOpener.getSecurityPincode() == 0)
if(!_configRead || !_nukiConfigValid)
{
jsonResult["general"] = "configNotReady";
serializeJson(jsonResult, _resbuf, sizeof(_resbuf));
_network->publishConfigCommandResult(_resbuf);
return;
}
if(!isPinSet())
{
jsonResult["general"] = "noPinSet";
serializeJson(jsonResult, _resbuf, sizeof(_resbuf));
@@ -1403,7 +1412,7 @@ void NukiOpenerWrapper::onKeypadCommandReceived(const char *command, const uint
void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
{
if(_nukiOpener.getSecurityPincode() == 0)
if(!isPinSet())
{
_network->publishKeypadJsonCommandResult("noPinSet");
return;
@@ -1746,7 +1755,13 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
void NukiOpenerWrapper::onTimeControlCommandReceived(const char *value)
{
if(_nukiOpener.getSecurityPincode() == 0)
if(!_configRead || !_nukiConfigValid)
{
_network->publishTimeControlCommandResult("configNotReady");
return;
}
if(!isPinSet())
{
_network->publishTimeControlCommandResult("noPinSet");
return;