From 7a46d45e7996253f89a88b30819c4c88ad9bbbe1 Mon Sep 17 00:00:00 2001 From: kayos Date: Tue, 24 Mar 2026 09:38:07 -0700 Subject: [PATCH] varroa: strip Wigle integration (deferred, not in base stack) --- .../varroa/viewmodel/SettingsViewModel.kt | 66 ------------------- 1 file changed, 66 deletions(-) diff --git a/app/src/main/java/com/adamaps/varroa/viewmodel/SettingsViewModel.kt b/app/src/main/java/com/adamaps/varroa/viewmodel/SettingsViewModel.kt index 70a3cfa..8e16e29 100644 --- a/app/src/main/java/com/adamaps/varroa/viewmodel/SettingsViewModel.kt +++ b/app/src/main/java/com/adamaps/varroa/viewmodel/SettingsViewModel.kt @@ -9,8 +9,6 @@ import com.adamaps.varroa.data.ApiResult import com.adamaps.varroa.data.SettingsDataStore import com.adamaps.varroa.data.SshStatus import com.adamaps.varroa.data.VarroaSettings -import com.adamaps.varroa.data.WigleStatus -import com.adamaps.varroa.data.WigleStats import com.adamaps.varroa.data.WifiStatus import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted @@ -66,15 +64,6 @@ class SettingsViewModel(app: Application) : AndroidViewModel(app) { private val _wifiConnectResult = MutableStateFlow(null) val wifiConnectResult: StateFlow = _wifiConnectResult.asStateFlow() - // WiGLE state - private val _wigleStatus = MutableStateFlow(null) - val wigleStatus: StateFlow = _wigleStatus.asStateFlow() - - private val _wigleStats = MutableStateFlow(null) - val wigleStats: StateFlow = _wigleStats.asStateFlow() - - private val _wigleConfigResult = MutableStateFlow(null) - val wigleConfigResult: StateFlow = _wigleConfigResult.asStateFlow() init { // Initialize BeeApiClient with stored settings and token @@ -90,7 +79,6 @@ class SettingsViewModel(app: Application) : AndroidViewModel(app) { if (s.isPaired) { refreshSshStatus() refreshWifiStatus() - refreshWigleStatus() } } } @@ -273,58 +261,4 @@ class SettingsViewModel(app: Application) : AndroidViewModel(app) { fun clearSshResult() { _sshToggleResult.value = null } - - // ── WiGLE ───────────────────────────────────────────────────────────────── - - /** - * Refresh WiGLE status from device. - */ - fun refreshWigleStatus() { - viewModelScope.launch { - val client = beeClient ?: return@launch - when (val result = client.getWigleStatus()) { - is ApiResult.Success -> { - _wigleStatus.value = result.data - } - is ApiResult.Error -> { - Log.w(TAG, "Failed to get WiGLE status: ${result.message}") - } - } - when (val result = client.getWigleStats()) { - is ApiResult.Success -> { - _wigleStats.value = result.data - } - is ApiResult.Error -> { - Log.w(TAG, "Failed to get WiGLE stats: ${result.message}") - } - } - } - } - - /** - * Set WiGLE configuration. - */ - fun setWigleConfig(enabled: Boolean, apiName: String, apiToken: String) { - viewModelScope.launch { - val client = beeClient ?: run { - _wigleConfigResult.value = "Not connected to device" - return@launch - } - _wigleConfigResult.value = null - - when (val result = client.setWigleConfig(enabled, apiName, apiToken)) { - is ApiResult.Success -> { - _wigleConfigResult.value = "WiGLE configuration saved" - refreshWigleStatus() - } - is ApiResult.Error -> { - _wigleConfigResult.value = "Failed: ${result.message}" - } - } - } - } - - fun clearWigleResult() { - _wigleConfigResult.value = null - } }