feat: add api configuration settings
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.logitech.vc.kirbytest
|
||||
|
||||
import SettingsRepository
|
||||
import android.annotation.SuppressLint
|
||||
import android.bluetooth.BluetoothDevice
|
||||
import android.bluetooth.BluetoothDevice.BOND_BONDED
|
||||
@@ -38,9 +39,11 @@ class KirbyDevice(
|
||||
private val connectionManager: ConnectionManager,
|
||||
private val bleDevice: BluetoothDevice,
|
||||
private val loggerDb: LoggerContract.LoggerDb,
|
||||
private val settingsRepository: SettingsRepository,
|
||||
private val onStateChange: (device: KirbyDevice) -> Unit,
|
||||
|
||||
|
||||
|
||||
) : BleListener(bleDevice.address), DeviceListEntry {
|
||||
private val queue: RequestQueue = Volley.newRequestQueue(context)
|
||||
|
||||
@@ -164,10 +167,11 @@ class KirbyDevice(
|
||||
}
|
||||
|
||||
private fun publishMeasurement(payload: String) {
|
||||
val accessKey = BuildConfig.API_KEY
|
||||
val url = BuildConfig.API_BASE_URL
|
||||
val settings = settingsRepository.readSettings()
|
||||
val accessKey = settings.apiKey
|
||||
val url = settings.apiUrl
|
||||
|
||||
if(url.isEmpty()) {
|
||||
if(url.isEmpty() || accessKey.isEmpty()) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user