MQTT interval default, remove orphaned code

This commit is contained in:
Garth Vander Houwen 2025-05-22 08:19:19 -07:00
parent b962c68ac2
commit 9ecfe6a3e7
2 changed files with 7 additions and 46 deletions

View file

@ -112,7 +112,6 @@ struct MQTTConfig: View {
Label("I have read and understand the above. I voluntarily consent to the unencrypted transmission of my node data via MQTT.", systemImage: "hand.raised")
.foregroundColor(.gray)
.font(.callout)
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
}
@ -429,8 +428,13 @@ struct MQTTConfig: View {
self.tlsEnabled = node?.mqttConfig?.tlsEnabled ?? false
self.mqttConnected = bleManager.mqttProxyConnected
self.mapReportingEnabled = node?.mqttConfig?.mapReportingEnabled ?? false
self.mapPublishIntervalSecs = Int(node?.mqttConfig?.mapPublishIntervalSecs ?? 3600)
if node?.mqttConfig?.mapPublishIntervalSecs ?? 0 < 3600 {
self.mapPublishIntervalSecs = 3600
} else {
self.mapPublishIntervalSecs = Int(node?.mqttConfig?.mapPublishIntervalSecs ?? 3600)
}
self.mapPositionPrecision = Double(node?.mqttConfig?.mapPositionPrecision ?? 14)
self.mapReportingOptIn = UserDefaults.mapReportingOptIn
if mapPositionPrecision < 11 || mapPositionPrecision > 14 {
self.mapPositionPrecision = 14
self.hasChanges = true