Consistent checks for context

This commit is contained in:
Garth Vander Houwen 2024-01-14 11:25:00 -08:00
parent 61168e826c
commit 61768bee9b
21 changed files with 61 additions and 38 deletions

View file

@ -240,9 +240,10 @@ struct DetectionSensorConfig: View {
ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "?")
})
.onAppear {
self.bleManager.context = context
if self.bleManager.context == nil {
self.bleManager.context = context
}
setDetectionSensorValues()
// Need to request a Detection Sensor Module Config from the remote node before allowing changes
if bleManager.connectedPeripheral != nil && node?.detectionSensorConfig == nil {
print("empty detection sensor module config")