varroa: strip Wigle integration (deferred, not in base stack)
This commit is contained in:
parent
068893714e
commit
44473990c1
1 changed files with 1 additions and 35 deletions
|
|
@ -677,38 +677,4 @@ class BeeApiClient(
|
||||||
return@withContext ApiResult.Error("Exception: ${e.message}")
|
return@withContext ApiResult.Error("Exception: ${e.message}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── WiGLE Wardriving API ──────────────────────────────────────────────────
|
|
||||||
|
|
||||||
suspend fun getWigleStatus(): ApiResult<com.adamaps.varroa.data.WigleStatus> = withContext(Dispatchers.IO) {
|
|
||||||
when (val r = getRaw("/api/1/wigle/status")) {
|
|
||||||
is ApiResult.Success -> try {
|
|
||||||
ApiResult.Success(gson.fromJson(r.data, com.adamaps.varroa.data.WigleStatus::class.java))
|
|
||||||
} catch (e: Exception) {
|
|
||||||
ApiResult.Error("Parse error: ${e.message}")
|
|
||||||
}
|
}
|
||||||
is ApiResult.Error -> r
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun getWigleStats(): ApiResult<com.adamaps.varroa.data.WigleStats> = withContext(Dispatchers.IO) {
|
|
||||||
when (val r = getRaw("/api/1/wigle/stats")) {
|
|
||||||
is ApiResult.Success -> try {
|
|
||||||
ApiResult.Success(gson.fromJson(r.data, com.adamaps.varroa.data.WigleStats::class.java))
|
|
||||||
} catch (e: Exception) {
|
|
||||||
ApiResult.Error("Parse error: ${e.message}")
|
|
||||||
}
|
|
||||||
is ApiResult.Error -> r
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun setWigleConfig(enabled: Boolean, apiName: String, apiToken: String): ApiResult<String> {
|
|
||||||
val json = gson.toJson(mapOf(
|
|
||||||
"enabled" to enabled,
|
|
||||||
"api_name" to apiName,
|
|
||||||
"api_token" to apiToken
|
|
||||||
))
|
|
||||||
return postRaw("/api/1/wigle/config", json)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue