kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
enable shutdown button for AXP192 only
rodzic
8e32ad81c0
commit
6cc67594c2
|
@ -204,6 +204,11 @@ class UIViewModel @Inject constructor(
|
|||
// We consider hasWifi = ESP32
|
||||
var isESP32: Boolean = _localConfig.value?.hasWifi() == true
|
||||
|
||||
fun hasAXP(): Boolean {
|
||||
val hasAXP = listOf(4, 7, 9) // mesh.proto 'HardwareModel' enums with AXP192 chip
|
||||
return hasAXP.contains(nodeDB.ourNodeInfo?.user?.hwModel?.number)
|
||||
}
|
||||
|
||||
/// hardware info about our local device (can be null)
|
||||
private val _myNodeInfo = MutableLiveData<MyNodeInfo?>()
|
||||
val myNodeInfo: LiveData<MyNodeInfo?> get() = _myNodeInfo
|
||||
|
|
|
@ -53,7 +53,7 @@ class AdvancedSettingsFragment : ScreenFragment("Advanced Settings"), Logging {
|
|||
binding.lsSleepView.isEnabled = connected && model.isPowerSaving ?: false
|
||||
binding.positionBroadcastSwitch.isEnabled = connected
|
||||
binding.lsSleepSwitch.isEnabled = connected && model.isESP32
|
||||
binding.shutdownButton.isEnabled = connected
|
||||
binding.shutdownButton.isEnabled = connected && model.hasAXP()
|
||||
binding.rebootButton.isEnabled = connected
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue