currentTemperature.value = getBatteryTemperature()
currentTemperature.value = getBatteryTemperature()
за пределами class AppCompat : AppCompatActivity()
currentTemperature.value = getBatteryTemperature()
fun getBatteryTemperature(context: Context): Int {
return context.registerReceiver(null, IntentFilter(Intent.ACTION_BATTERY_CHANGED))!!.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, 0) / 10
}