fix(data): Persist TAK module config (#5933)

This commit is contained in:
Jeremiah K
2026-06-24 12:04:55 -05:00
committed by GitHub
parent f1a7982a4d
commit 45a27ab5d9
2 changed files with 4 additions and 0 deletions

View File

@@ -130,5 +130,6 @@ private fun ModuleConfig.summarize(): String = when {
detection_sensor != null -> "detection_sensor"
paxcounter != null -> "paxcounter"
statusmessage != null -> "statusmessage"
tak != null -> "tak"
else -> "unknown"
}

View File

@@ -47,6 +47,7 @@ class ModuleConfigDataSource(
}
/** Updates [LocalModuleConfig] from each [ModuleConfig] oneOf. */
@Suppress("CyclomaticComplexMethod")
suspend fun setLocalModuleConfig(config: ModuleConfig) = moduleConfigStore.updateData { current ->
when {
config.mqtt != null -> current.copy(mqtt = config.mqtt)
@@ -78,6 +79,8 @@ class ModuleConfigDataSource(
config.statusmessage != null -> current.copy(statusmessage = config.statusmessage)
config.tak != null -> current.copy(tak = config.tak)
else -> current
}
}