Merge pull request #85 from meshtastic/feature/new_config

Prevent both is powered and is power saving from both being on
This commit is contained in:
Garth Vander Houwen 2022-06-12 22:14:42 -07:00 committed by GitHub
commit 87104ad821
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)