From a3964edb86f2def3b44e95923193a59c67bbd267 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Sun, 12 Jun 2022 22:14:06 -0700 Subject: [PATCH] Prevent both is powered and is power saving from both being on --- MeshtasticApple/Views/Settings/PowerConfig.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MeshtasticApple/Views/Settings/PowerConfig.swift b/MeshtasticApple/Views/Settings/PowerConfig.swift index fde78abd..d47461a6 100644 --- a/MeshtasticApple/Views/Settings/PowerConfig.swift +++ b/MeshtasticApple/Views/Settings/PowerConfig.swift @@ -29,6 +29,7 @@ struct PowerConfig: View { Label("Power Saving", systemImage: "powersleep") } .toggleStyle(SwitchToggleStyle(tint: .accentColor)) + .disabled(isAlwaysPowered) Text("If set, we are powered from a low-current source (i.e. solar), so even if it looks like we have power flowing in we should try to minimize power consumption as much as possible.") .font(.caption) .listRowSeparator(.visible) @@ -38,6 +39,7 @@ struct PowerConfig: View { Label("Always Powered", systemImage: "powerplug.fill") } .toggleStyle(SwitchToggleStyle(tint: .accentColor)) + .disabled(isPowerSaving) Text("Circumvents the logic block for determining whether the device is powered or not. Useful for devices with finicky ADC issues on the battery sense pins, or no battery pin at all.") .font(.caption) .listRowSeparator(.visible)