Fixed issue with Bell Assignments

This commit is contained in:
2025-10-26 11:08:19 +02:00
parent d1835beff5
commit 06891e8d82
5 changed files with 85 additions and 5 deletions

View File

@@ -358,9 +358,15 @@ void CommandHandler::handleSetRelayTimersCommand(JsonVariant contents, const Mes
void CommandHandler::handleSetRelayOutputsCommand(JsonVariant contents, const MessageContext& context) {
try {
_configManager.updateBellOutputs(contents);
// Note: Bell outputs are typically not persisted to SD card as they're more of a mapping configuration
sendSuccessResponse("set_relay_outputs", "Relay outputs updated", context);
LOG_INFO("Relay outputs updated successfully");
// Save bell outputs configuration to SD card for persistence
bool saved = _configManager.saveBellOutputs();
if (saved) {
sendSuccessResponse("set_relay_outputs", "Relay outputs updated and saved", context);
LOG_INFO("Relay outputs updated and saved successfully");
} else {
sendErrorResponse("set_relay_outputs", "Failed to save relay outputs to SD card", context);
LOG_ERROR("Failed to save relay outputs configuration");
}
} catch (...) {
sendErrorResponse("set_relay_outputs", "Failed to update relay outputs", context);
LOG_ERROR("Exception occurred while updating relay outputs");