Merge pull request #408 from meshtastic/connection-sleep

Issue #392 - fix connected but sleeping text to reflect actual device state
This commit is contained in:
Andre Kirchhoff authored and GitHub committed 2022-04-07 23:53:05 -03:00
commit caae04c2ff
19 files changed
+21 -19

No files matched your search

@@ -1225,8 +1225,10 @@ class MeshService : Service(), Logging {
when (intent.action) {
RadioInterfaceService.RADIO_CONNECTED_ACTION -> {
try {
// sleep now disabled by default on ESP32, permanent is true unless isPowerSaving enabled
val lsEnabled = radioConfig?.preferences?.isPowerSaving ?: false
val connected = intent.getBooleanExtra(EXTRA_CONNECTED, false)
val permanent = intent.getBooleanExtra(EXTRA_PERMANENT, false)
val permanent = intent.getBooleanExtra(EXTRA_PERMANENT, false) || !lsEnabled
onConnectionChanged(
when {
connected -> ConnectionState.CONNECTED