mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Hide esp32 sleep options
This commit is contained in:
parent
4fe467f988
commit
32fe4f1ca1
3 changed files with 28 additions and 30 deletions
|
|
@ -532,7 +532,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
connectedPeripheral.name = myInfo?.bleName ?? "unknown".localized
|
||||
connectedPeripheral.longName = myInfo?.bleName ?? "unknown".localized
|
||||
}
|
||||
tryClearExistingChannels()
|
||||
//tryClearExistingChannels()
|
||||
}
|
||||
// NodeInfo
|
||||
if decodedInfo.nodeInfo.num > 0 {// && !invalidVersion {
|
||||
|
|
|
|||
|
|
@ -155,8 +155,7 @@ func channelPacket (channel: Channel, fromNum: Int64, context: NSManagedObjectCo
|
|||
guard let mutableChannels = fetchedMyInfo[0].channels!.mutableCopy() as? NSMutableOrderedSet else {
|
||||
return
|
||||
}
|
||||
if mutableChannels.contains(newChannel) {
|
||||
let oldChannel = mutableChannels.first(where: {($0 as AnyObject).index == newChannel.index }) as! ChannelEntity
|
||||
if let oldChannel = mutableChannels.first(where: {($0 as AnyObject).index == newChannel.index }) as? ChannelEntity {
|
||||
newChannel.mute = oldChannel.mute
|
||||
let index = mutableChannels.index(of: oldChannel as Any)
|
||||
mutableChannels.replaceObject(at: index, with: newChannel)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ struct PowerConfig: View {
|
|||
if currentDevice?.architecture == .esp32 || currentDevice?.architecture == .esp32S3 {
|
||||
Toggle(isOn: $isPowerSaving) {
|
||||
Label("Power Saving", systemImage: "bolt")
|
||||
Text("Will sleep everything as much as possible, for the tracker and sensor role this will also include the lora radio. Don't use this setting if you want to use your device with the phone apps.")
|
||||
Text("Will sleep everything as much as possible, for the tracker and sensor role this will also include the lora radio. Don't use this setting if you want to use your device with the phone apps or are using a device without a user button.")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
}
|
||||
|
|
@ -71,32 +71,31 @@ struct PowerConfig: View {
|
|||
} header: {
|
||||
Text("Battery")
|
||||
}
|
||||
|
||||
Section {
|
||||
Picker("power.wait.bluetooth.secs", selection: $waitBluetoothSecs) {
|
||||
ForEach(PowerIntervals.allCases) {
|
||||
Text($0.description)
|
||||
}
|
||||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
|
||||
Picker("power.ls.secs", selection: $lsSecs) {
|
||||
ForEach(PowerIntervals.allCases) {
|
||||
Text($0.description)
|
||||
}
|
||||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
|
||||
Picker("power.min.wake.secs", selection: $minWakeSecs) {
|
||||
ForEach(PowerIntervals.allCases) {
|
||||
Text($0.description)
|
||||
}
|
||||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
|
||||
} header: {
|
||||
Text("Sleep")
|
||||
}
|
||||
// Section {
|
||||
// Picker("power.wait.bluetooth.secs", selection: $waitBluetoothSecs) {
|
||||
// ForEach(PowerIntervals.allCases) {
|
||||
// Text($0.description)
|
||||
// }
|
||||
// }
|
||||
// .pickerStyle(DefaultPickerStyle())
|
||||
//
|
||||
// Picker("power.ls.secs", selection: $lsSecs) {
|
||||
// ForEach(PowerIntervals.allCases) {
|
||||
// Text($0.description)
|
||||
// }
|
||||
// }
|
||||
// .pickerStyle(DefaultPickerStyle())
|
||||
//
|
||||
// Picker("power.min.wake.secs", selection: $minWakeSecs) {
|
||||
// ForEach(PowerIntervals.allCases) {
|
||||
// Text($0.description)
|
||||
// }
|
||||
// }
|
||||
// .pickerStyle(DefaultPickerStyle())
|
||||
//
|
||||
// } header: {
|
||||
// Text("Sleep")
|
||||
// }
|
||||
}
|
||||
}
|
||||
.disabled(self.bleManager.connectedPeripheral == nil || node?.powerConfig == nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue