mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
region setting from android now kinda works
This commit is contained in:
parent
81e76bfc51
commit
bd1885aaf2
3 changed files with 76 additions and 37 deletions
|
|
@ -124,12 +124,7 @@ class UIViewModel(private val app: Application) : AndroidViewModel(app), Logging
|
|||
}
|
||||
|
||||
var lsSleepSecs: Int?
|
||||
get() {
|
||||
radioConfig.value?.preferences?.let {
|
||||
return it.lsSecs
|
||||
}
|
||||
return null
|
||||
}
|
||||
get() = radioConfig.value?.preferences?.lsSecs
|
||||
set(value) {
|
||||
val config = radioConfig.value
|
||||
if (value != null && config != null) {
|
||||
|
|
@ -139,6 +134,17 @@ class UIViewModel(private val app: Application) : AndroidViewModel(app), Logging
|
|||
}
|
||||
}
|
||||
|
||||
var region: RadioConfigProtos.RegionCode?
|
||||
get() = radioConfig.value?.preferences?.region
|
||||
set(value) {
|
||||
val config = radioConfig.value
|
||||
if (value != null && config != null) {
|
||||
val builder = config.toBuilder()
|
||||
builder.preferencesBuilder.region = value
|
||||
setRadioConfig(builder.build())
|
||||
}
|
||||
}
|
||||
|
||||
/// hardware info about our local device (can be null)
|
||||
val myNodeInfo = object : MutableLiveData<MyNodeInfo?>(null) {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue