package com.syaroful.agrilinkvocpro.growth_recipe_feature.core.utils

import com.syaroful.agrilinkvocpro.growth_recipe_feature.data.model.NpkWithDay

fun getValuesForSensorNpk(sensor: String, data: List<NpkWithDay>): List<Double> {
    return when (sensor) {
        "Nitrogen" -> data.mapNotNull { it.soilNitrogen?.toDouble() }
        "Pospor" -> data.mapNotNull { it.soilPhosphorus?.toDouble() }
        "Kalium" -> data.mapNotNull { it.soilPotassium?.toDouble() }
        "Suhu Tanah" -> data.mapNotNull { it.soilTemperature?.toDouble() }
        "PH Tanah" -> data.mapNotNull { it.soilPh?.toDouble() }
        "Kelembapan" -> data.mapNotNull { it.soilHumidity?.toDouble() }
        "Konduktivitas" -> data.mapNotNull { it.soilConductivity?.toDouble() }
        else -> emptyList()
    }
}