Hide json setting from proxy

This commit is contained in:
Garth Vander Houwen 2025-02-11 11:52:37 -08:00
parent c9a2724538
commit c29c515ab5

View file

@ -82,11 +82,13 @@ struct MQTTConfig: View {
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
Toggle(isOn: $jsonEnabled) {
Label("JSON Enabled", systemImage: "ellipsis.curlybraces")
Text("JSON mode is a limited, unencrypted MQTT output for locally integrating with home assistant")
if !proxyToClientEnabled {
Toggle(isOn: $jsonEnabled) {
Label("JSON Enabled", systemImage: "ellipsis.curlybraces")
Text("JSON mode is a limited, unencrypted MQTT output for locally integrating with home assistant")
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
}
Section(header: Text("Map Report")) {
@ -276,7 +278,7 @@ struct MQTTConfig: View {
}
if newProxyToClientEnabled != node?.mqttConfig?.proxyToClientEnabled { hasChanges = true }
}
.onChange(of: address) { _, newAddress in
.onChange(of: address) { newAddress in
if newAddress != node?.mqttConfig?.address ?? "" { hasChanges = true }
}
.onChange(of: username) { newUsername in
@ -285,7 +287,7 @@ struct MQTTConfig: View {
.onChange(of: password) { newPassword in
if newPassword != node?.mqttConfig?.password ?? "" { hasChanges = true }
}
.onChange(of: root) { newRoot in
.onChange(of: root) { _, newRoot in
if newRoot != node?.mqttConfig?.root ?? "" { hasChanges = true }
}
.onChange(of: selectedTopic) { _, newSelectedTopic in