Extend config
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,4 @@
|
||||
[submodule "lib/nuki_ble"]
|
||||
path = lib/nuki_ble
|
||||
url = https://github.com/technyon/nuki_ble.git
|
||||
url = https://github.com/iranl/NukiBleEsp32.git
|
||||
branch = extend-config
|
||||
|
||||
@@ -464,7 +464,7 @@ void NetworkLock::publishConfig(const NukiLock::Config &config)
|
||||
|
||||
json["nukiID"] = uidString;
|
||||
json["name"] = config.name;
|
||||
json["latitude"] = config.latitide;
|
||||
json["latitude"] = config.latitude;
|
||||
json["autoUnlatch"] = config.autoUnlatch;
|
||||
json["longitude"] = config.longitude;
|
||||
json["pairingEnabled"] = config.pairingEnabled;
|
||||
|
||||
@@ -509,7 +509,7 @@ void NetworkOpener::publishConfig(const NukiOpener::Config &config)
|
||||
|
||||
json["nukiID"] = uidString;
|
||||
json["name"] = config.name;
|
||||
json["latitude"] = config.latitide;
|
||||
json["latitude"] = config.latitude;
|
||||
json["longitude"] = config.longitude;
|
||||
memset(str, 0, sizeof(str));
|
||||
capabilitiesToString(config.capabilities, str);
|
||||
@@ -561,7 +561,7 @@ void NetworkOpener::publishAdvancedConfig(const NukiOpener::AdvancedConfig &conf
|
||||
|
||||
json["intercomID"] = config.intercomID;
|
||||
json["busModeSwitch"] = config.busModeSwitch;
|
||||
json["shortCircuitDaration"] = config.shortCircuitDaration;
|
||||
json["shortCircuitDuration"] = config.shortCircuitDuration;
|
||||
json["electricStrikeDelay"] = config.electricStrikeDelay;
|
||||
json["randomElectricStrikeDelay"] = config.randomElectricStrikeDelay;
|
||||
json["electricStrikeDuration"] = config.electricStrikeDuration;
|
||||
|
||||
@@ -694,7 +694,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
|
||||
Nuki::CmdResult cmdResult;
|
||||
const char *basicKeys[] = {"name", "latitude", "longitude", "pairingEnabled", "buttonEnabled", "ledFlashEnabled", "timeZoneOffset", "dstMode", "fobAction1", "fobAction2", "fobAction3", "operatingMode", "advertisingMode", "timeZone"};
|
||||
const char *advancedKeys[] = {"intercomID", "busModeSwitch", "shortCircuitDaration", "electricStrikeDelay", "randomElectricStrikeDelay", "electricStrikeDuration", "disableRtoAfterRing", "rtoTimeout", "doorbellSuppression", "doorbellSuppressionDuration", "soundRing", "soundOpen", "soundRto", "soundCm", "soundConfirmation", "soundLevel", "singleButtonPressAction", "doubleButtonPressAction", "batteryType", "automaticBatteryTypeDetection"};
|
||||
const char *advancedKeys[] = {"intercomID", "busModeSwitch", "shortCircuitDuration", "electricStrikeDelay", "randomElectricStrikeDelay", "electricStrikeDuration", "disableRtoAfterRing", "rtoTimeout", "doorbellSuppression", "doorbellSuppressionDuration", "soundRing", "soundOpen", "soundRto", "soundCm", "soundConfirmation", "soundLevel", "singleButtonPressAction", "doubleButtonPressAction", "batteryType", "automaticBatteryTypeDetection"};
|
||||
bool basicUpdated = false;
|
||||
bool advancedUpdated = false;
|
||||
uint32_t basicOpenerConfigAclPrefs[16];
|
||||
@@ -730,8 +730,8 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
|
||||
if(keyvalue > 0)
|
||||
{
|
||||
if(_nukiConfig.latitide == keyvalue) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setLatitude(keyvalue);
|
||||
if(_nukiConfig.latitude == keyvalue) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else cmdResult = _nukiOpener.setLatitude(keyvalue);
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -742,7 +742,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue > 0)
|
||||
{
|
||||
if(_nukiConfig.longitude == keyvalue) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setLongitude(keyvalue);
|
||||
else cmdResult = _nukiOpener.setLongitude(keyvalue);
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -808,7 +808,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(fobAct1 != 99)
|
||||
{
|
||||
if(_nukiConfig.fobAction1 == fobAct1) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setFobAction(1, fobAct1);
|
||||
else cmdResult = _nukiOpener.setFobAction(1, fobAct1);
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -819,7 +819,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(fobAct2 != 99)
|
||||
{
|
||||
if(_nukiConfig.fobAction2 == fobAct2) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setFobAction(2, fobAct2);
|
||||
else cmdResult = _nukiOpener.setFobAction(2, fobAct2);
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -830,7 +830,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(fobAct3 != 99)
|
||||
{
|
||||
if(_nukiConfig.fobAction3 == fobAct3) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setFobAction(3, fobAct3);
|
||||
else cmdResult = _nukiOpener.setFobAction(3, fobAct3);
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -841,7 +841,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(opmode != 99)
|
||||
{
|
||||
if(_nukiConfig.operatingMode == opmode) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setOperatingMode(opmode);
|
||||
else cmdResult = _nukiOpener.setOperatingMode(opmode);
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -895,7 +895,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 0)
|
||||
{
|
||||
if(_nukiAdvancedConfig.intercomID == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setIntercomID(keyvalue);
|
||||
else cmdResult = _nukiOpener.setIntercomID(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -906,18 +906,18 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue == 0 || keyvalue == 1)
|
||||
{
|
||||
if(_nukiAdvancedConfig.busModeSwitch == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setBusModeSwitch((keyvalue > 0));
|
||||
else cmdResult = _nukiOpener.setBusModeSwitch((keyvalue > 0));
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
else if(strcmp(advancedKeys[i], "shortCircuitDaration") == 0)
|
||||
else if(strcmp(advancedKeys[i], "shortCircuitDuration") == 0)
|
||||
{
|
||||
const uint16_t keyvalue = atoi(json[advancedKeys[i]]);
|
||||
|
||||
if(keyvalue >= 0)
|
||||
{
|
||||
if(_nukiAdvancedConfig.shortCircuitDaration == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setShortCircuitDaration(keyvalue);
|
||||
if(_nukiAdvancedConfig.shortCircuitDuration == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else cmdResult = _nukiOpener.setShortCircuitDuration(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -928,7 +928,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 0 && keyvalue <= 30000)
|
||||
{
|
||||
if(_nukiAdvancedConfig.electricStrikeDelay == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setElectricStrikeDelay(keyvalue);
|
||||
else cmdResult = _nukiOpener.setElectricStrikeDelay(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -939,7 +939,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue == 0 || keyvalue == 1)
|
||||
{
|
||||
if(_nukiAdvancedConfig.randomElectricStrikeDelay == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.enableRandomElectricStrikeDelay((keyvalue > 0));
|
||||
else cmdResult = _nukiOpener.enableRandomElectricStrikeDelay((keyvalue > 0));
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -950,7 +950,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 1000 && keyvalue <= 30000)
|
||||
{
|
||||
if(_nukiAdvancedConfig.electricStrikeDuration == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setElectricStrikeDuration(keyvalue);
|
||||
else cmdResult = _nukiOpener.setElectricStrikeDuration(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -961,7 +961,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue == 0 || keyvalue == 1)
|
||||
{
|
||||
if(_nukiAdvancedConfig.disableRtoAfterRing == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.disableRtoAfterRing((keyvalue > 0));
|
||||
else cmdResult = _nukiOpener.disableRtoAfterRing((keyvalue > 0));
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -972,7 +972,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 5 && keyvalue <= 60)
|
||||
{
|
||||
if(_nukiAdvancedConfig.rtoTimeout == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setRtoTimeout(keyvalue);
|
||||
else cmdResult = _nukiOpener.setRtoTimeout(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -980,10 +980,10 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
{
|
||||
const uint8_t keyvalue = atoi(json[advancedKeys[i]]);
|
||||
|
||||
if(keyvalue >= 0)
|
||||
if(keyvalue >= 0 && keyvalue <= 8)
|
||||
{
|
||||
if(_nukiAdvancedConfig.doorbellSuppression == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setDoorbellSuppression(keyvalue);
|
||||
else cmdResult = _nukiOpener.setDoorbellSuppression(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -994,7 +994,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 500 && keyvalue <= 10000)
|
||||
{
|
||||
if(_nukiAdvancedConfig.doorbellSuppressionDuration == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setDoorbellSuppressionDuration(keyvalue);
|
||||
else cmdResult = _nukiOpener.setDoorbellSuppressionDuration(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -1005,7 +1005,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 0 && keyvalue <= 3)
|
||||
{
|
||||
if(_nukiAdvancedConfig.soundRing == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setSoundRing(keyvalue);
|
||||
else cmdResult = _nukiOpener.setSoundRing(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -1016,7 +1016,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 0 && keyvalue <= 3)
|
||||
{
|
||||
if(_nukiAdvancedConfig.soundOpen == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setSoundOpen(keyvalue);
|
||||
else cmdResult = _nukiOpener.setSoundOpen(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -1027,7 +1027,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 0 && keyvalue <= 3)
|
||||
{
|
||||
if(_nukiAdvancedConfig.soundRto == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setSoundRto(keyvalue);
|
||||
else cmdResult = _nukiOpener.setSoundRto(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -1038,7 +1038,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 0 && keyvalue <= 3)
|
||||
{
|
||||
if(_nukiAdvancedConfig.soundCm == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.setSoundCm(keyvalue);
|
||||
else cmdResult = _nukiOpener.setSoundCm(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -1049,7 +1049,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue == 0 || keyvalue == 1)
|
||||
{
|
||||
if(_nukiAdvancedConfig.soundConfirmation == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiOpener.enableSoundConfirmation((keyvalue > 0));
|
||||
else cmdResult = _nukiOpener.enableSoundConfirmation((keyvalue > 0));
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
|
||||
@@ -682,8 +682,8 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
|
||||
if(keyvalue > 0)
|
||||
{
|
||||
if(_nukiConfig.latitide == keyvalue) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setLatitude(keyvalue);
|
||||
if(_nukiConfig.latitude == keyvalue) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else cmdResult = _nukiLock.setLatitude(keyvalue);
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -694,7 +694,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue > 0)
|
||||
{
|
||||
if(_nukiConfig.longitude == keyvalue) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setLongitude(keyvalue);
|
||||
else cmdResult = _nukiLock.setLongitude(keyvalue);
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -705,7 +705,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue == 0 || keyvalue == 1)
|
||||
{
|
||||
if(_nukiConfig.autoUnlatch == keyvalue) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.enableAutoUnlatch((keyvalue > 0));
|
||||
else cmdResult = _nukiLock.enableAutoUnlatch((keyvalue > 0));
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -782,7 +782,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(fobAct1 != 99)
|
||||
{
|
||||
if(_nukiConfig.fobAction1 == fobAct1) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setFobAction(1, fobAct1);
|
||||
else cmdResult = _nukiLock.setFobAction(1, fobAct1);
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -793,7 +793,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(fobAct2 != 99)
|
||||
{
|
||||
if(_nukiConfig.fobAction2 == fobAct2) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setFobAction(2, fobAct2);
|
||||
else cmdResult = _nukiLock.setFobAction(2, fobAct2);
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -804,7 +804,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(fobAct3 != 99)
|
||||
{
|
||||
if(_nukiConfig.fobAction3 == fobAct3) jsonResult[basicKeys[i]] = "unchanged";
|
||||
else jsonResult[basicKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setFobAction(3, fobAct3);
|
||||
else cmdResult = _nukiLock.setFobAction(3, fobAct3);
|
||||
}
|
||||
else jsonResult[basicKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -869,7 +869,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= -90 && keyvalue <= 180)
|
||||
{
|
||||
if(_nukiAdvancedConfig.unlockedPositionOffsetDegrees == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setUnlockedPositionOffsetDegrees(keyvalue);
|
||||
else cmdResult = _nukiLock.setUnlockedPositionOffsetDegrees(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -880,7 +880,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= -180 && keyvalue <= 90)
|
||||
{
|
||||
if(_nukiAdvancedConfig.lockedPositionOffsetDegrees == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setLockedPositionOffsetDegrees(keyvalue);
|
||||
else cmdResult = _nukiLock.setLockedPositionOffsetDegrees(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -891,7 +891,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= -180 && keyvalue <= 180)
|
||||
{
|
||||
if(_nukiAdvancedConfig.singleLockedPositionOffsetDegrees == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setSingleLockedPositionOffsetDegrees(keyvalue);
|
||||
else cmdResult = _nukiLock.setSingleLockedPositionOffsetDegrees(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -902,7 +902,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= -180 && keyvalue <= 180)
|
||||
{
|
||||
if(_nukiAdvancedConfig.unlockedToLockedTransitionOffsetDegrees == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setUnlockedToLockedTransitionOffsetDegrees(keyvalue);
|
||||
else cmdResult = _nukiLock.setUnlockedToLockedTransitionOffsetDegrees(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -913,7 +913,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 5 && keyvalue <= 60)
|
||||
{
|
||||
if(_nukiAdvancedConfig.lockNgoTimeout == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setLockNgoTimeout(keyvalue);
|
||||
else cmdResult = _nukiLock.setLockNgoTimeout(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -946,7 +946,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue == 0 || keyvalue == 1)
|
||||
{
|
||||
if(_nukiAdvancedConfig.detachedCylinder == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.enableDetachedCylinder((keyvalue > 0));
|
||||
else cmdResult = _nukiLock.enableDetachedCylinder((keyvalue > 0));
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -979,7 +979,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 1 && keyvalue <= 30)
|
||||
{
|
||||
if(_nukiAdvancedConfig.unlatchDuration == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setUnlatchDuration(keyvalue);
|
||||
else cmdResult = _nukiLock.setUnlatchDuration(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -990,7 +990,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue >= 30 && keyvalue <= 180)
|
||||
{
|
||||
if(_nukiAdvancedConfig.autoLockTimeOut == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setAutoLockTimeOut(keyvalue);
|
||||
else cmdResult = _nukiLock.setAutoLockTimeOut(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -1012,7 +1012,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue == 0 || keyvalue == 1)
|
||||
{
|
||||
if(_nukiAdvancedConfig.nightModeEnabled == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.enableNightMode((keyvalue > 0));
|
||||
else cmdResult = _nukiLock.enableNightMode((keyvalue > 0));
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -1020,12 +1020,12 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
{
|
||||
String keystr = json[advancedKeys[i]];
|
||||
unsigned char keyvalue[2];
|
||||
keyvalue[1] = (uint8_t)atoi(keystr.substring(0, 2).c_str());
|
||||
keyvalue[2] = (uint8_t)atoi(keystr.substring(3, 5).c_str());
|
||||
keyvalue[0] = (uint8_t)atoi(keystr.substring(0, 2).c_str());
|
||||
keyvalue[1] = (uint8_t)atoi(keystr.substring(3, 5).c_str());
|
||||
if(keyvalue[0] >= 0 && keyvalue[0] <= 23 && keyvalue[1] >= 0 && keyvalue[1] <= 59)
|
||||
{
|
||||
if(_nukiAdvancedConfig.nightModeStartTime == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setNightModeStartTime(keyvalue);
|
||||
else cmdResult = _nukiLock.setNightModeStartTime(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -1033,14 +1033,14 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
{
|
||||
String keystr = json[advancedKeys[i]];
|
||||
unsigned char keyvalue[2];
|
||||
keyvalue[1] = (uint8_t)atoi(keystr.substring(0, 2).c_str());
|
||||
keyvalue[2] = (uint8_t)atoi(keystr.substring(3, 5).c_str());
|
||||
keyvalue[0] = (uint8_t)atoi(keystr.substring(0, 2).c_str());
|
||||
keyvalue[1] = (uint8_t)atoi(keystr.substring(3, 5).c_str());
|
||||
if(keyvalue[0] >= 0 && keyvalue[0] <= 23 && keyvalue[1] >= 0 && keyvalue[1] <= 59)
|
||||
{
|
||||
if(_nukiAdvancedConfig.nightModeEndTime == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.setNightModeEndTime(keyvalue);
|
||||
else cmdResult = _nukiLock.setNightModeEndTime(keyvalue);
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
else if(strcmp(advancedKeys[i], "nightModeAutoLockEnabled") == 0)
|
||||
{
|
||||
@@ -1049,7 +1049,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue == 0 || keyvalue == 1)
|
||||
{
|
||||
if(_nukiAdvancedConfig.nightModeAutoLockEnabled == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.enableNightModeAutoLock((keyvalue > 0));
|
||||
else cmdResult = _nukiLock.enableNightModeAutoLock((keyvalue > 0));
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -1060,7 +1060,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue == 0 || keyvalue == 1)
|
||||
{
|
||||
if(_nukiAdvancedConfig.nightModeAutoUnlockDisabled == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.disableNightModeAutoUnlock((keyvalue > 0));
|
||||
else cmdResult = _nukiLock.disableNightModeAutoUnlock((keyvalue > 0));
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
@@ -1071,7 +1071,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
if(keyvalue == 0 || keyvalue == 1)
|
||||
{
|
||||
if(_nukiAdvancedConfig.nightModeImmediateLockOnStart == keyvalue) jsonResult[advancedKeys[i]] = "unchanged";
|
||||
else jsonResult[advancedKeys[i]] = "notimplemented"; //cmdResult = _nukiLock.enableNightModeImmediateLockOnStart((keyvalue > 0));
|
||||
else cmdResult = _nukiLock.enableNightModeImmediateLockOnStart((keyvalue > 0));
|
||||
}
|
||||
else jsonResult[advancedKeys[i]] = "invalidvalue";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user