cleanup project config from unused observer code

This commit is contained in:
Lorow
2024-12-11 22:40:34 +01:00
parent fff9ce422f
commit 983c5fa473
6 changed files with 20 additions and 87 deletions

View File

@@ -44,8 +44,7 @@ CommandResult updateCameraCommand::execute(std::string_view jsonPayload)
updatedConfig.framesize.has_value() ? updatedConfig.framesize.value() : oldConfig.framesize,
updatedConfig.href.has_value() ? updatedConfig.href.value() : oldConfig.href,
updatedConfig.quality.has_value() ? updatedConfig.quality.value() : oldConfig.quality,
updatedConfig.brightness.has_value() ? updatedConfig.brightness.value() : oldConfig.brightness,
true);
updatedConfig.brightness.has_value() ? updatedConfig.brightness.value() : oldConfig.brightness);
return CommandResult::getSuccessResult("Config updated");
}

View File

@@ -26,7 +26,7 @@ CommandResult setMDNSCommand::execute(std::string_view jsonPayload)
if (!payload.has_value())
return CommandResult::getErrorResult("Invalid payload");
projectConfig->setMDNSConfig(payload.value().hostname, true);
projectConfig->setMDNSConfig(payload.value().hostname);
return CommandResult::getSuccessResult("Config updated");
}

View File

@@ -60,8 +60,7 @@ CommandResult setWiFiCommand::execute(std::string_view jsonPayload)
wifiConfig.ssid,
wifiConfig.password,
wifiConfig.channel,
wifiConfig.power,
true);
wifiConfig.power);
return CommandResult::getSuccessResult("Config updated");
}
@@ -93,7 +92,7 @@ CommandResult deleteWifiCommand::execute(std::string_view jsonPayload)
if (!payload.has_value())
return CommandResult::getErrorResult("Invalid payload");
projectConfig->deleteWifiConfig(payload.value().networkName, false);
projectConfig->deleteWifiConfig(payload.value().networkName);
return CommandResult::getSuccessResult("Config updated");
}
@@ -164,8 +163,7 @@ CommandResult updateWifiCommand::execute(std::string_view jsonPayload)
updatedConfig.ssid.has_value() ? updatedConfig.ssid.value() : networkToUpdate->ssid,
updatedConfig.password.has_value() ? updatedConfig.password.value() : networkToUpdate->password,
updatedConfig.channel.has_value() ? updatedConfig.channel.value() : networkToUpdate->channel,
updatedConfig.power.has_value() ? updatedConfig.power.value() : networkToUpdate->power,
false);
updatedConfig.power.has_value() ? updatedConfig.power.value() : networkToUpdate->power);
return CommandResult::getSuccessResult("Config updated");
}