Reintroduce temperature field
This commit is contained in:
parent
958c576a5e
commit
89e81c3c3d
@ -16,6 +16,7 @@ import de.timklge.karooheadwind.datatypes.RelativeHumidityDataType
|
||||
import de.timklge.karooheadwind.datatypes.SealevelPressureDataType
|
||||
import de.timklge.karooheadwind.datatypes.SurfacePressureDataType
|
||||
import de.timklge.karooheadwind.datatypes.TailwindAndRideSpeedDataType
|
||||
import de.timklge.karooheadwind.datatypes.TemperatureDataType
|
||||
import de.timklge.karooheadwind.datatypes.TemperatureForecastDataType
|
||||
import de.timklge.karooheadwind.datatypes.WeatherForecastDataType
|
||||
import de.timklge.karooheadwind.datatypes.WindDirectionAndSpeedDataType
|
||||
@ -82,6 +83,7 @@ class KarooHeadwindExtension : KarooExtension("karoo-headwind", BuildConfig.VERS
|
||||
WindDirectionAndSpeedDataType(karooSystem, applicationContext),
|
||||
RelativeGradeDataType(karooSystem, applicationContext),
|
||||
RelativeElevationGainDataType(karooSystem, applicationContext),
|
||||
TemperatureDataType(karooSystem, applicationContext)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
package de.timklge.karooheadwind.datatypes
|
||||
|
||||
import android.content.Context
|
||||
import de.timklge.karooheadwind.weatherprovider.WeatherData
|
||||
import io.hammerhead.karooext.KarooSystemService
|
||||
import io.hammerhead.karooext.models.DataType
|
||||
import io.hammerhead.karooext.models.UserProfile
|
||||
|
||||
class TemperatureDataType(karooSystemService: KarooSystemService, context: Context) : BaseDataType(karooSystemService, context, "temperature"){
|
||||
override fun getValue(data: WeatherData, userProfile: UserProfile): Double {
|
||||
return data.temperature
|
||||
}
|
||||
|
||||
override fun getFormatDataType(): String? {
|
||||
return DataType.Type.TEMPERATURE
|
||||
}
|
||||
}
|
||||
@ -29,6 +29,8 @@
|
||||
<string name="wind_forecast_description">Current hourly wind forecast</string>
|
||||
<string name="precipitation_forecast">Precipitation Forecast</string>
|
||||
<string name="precipitation_forecast_description">Current hourly precipitation forecast</string>
|
||||
<string name="temperature">Temperature</string>
|
||||
<string name="temperature_description">Current temperature in configured unit</string>
|
||||
<string name="headwind_speed">Headwind speed</string>
|
||||
<string name="headwind_speed_description">Current headwind speed</string>
|
||||
<string name="userwind_speed_description">Current headwind or wind speed based on user setting</string>
|
||||
|
||||
@ -117,6 +117,13 @@
|
||||
icon="@drawable/ic_cloud"
|
||||
typeId="sealevelPressure" />
|
||||
|
||||
<DataType
|
||||
description="@string/temperature_description"
|
||||
displayName="@string/temperature"
|
||||
graphical="false"
|
||||
icon="@drawable/thermometer"
|
||||
typeId="temperature" />
|
||||
|
||||
<DataType
|
||||
description="@string/relativeGrade_description"
|
||||
displayName="@string/relativeGrade"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user