[F] Fix battery info

This commit is contained in:
Azalea Gui
2023-01-24 01:02:05 -05:00
parent 9eb413ec25
commit c7030af398
@@ -7,9 +7,9 @@ import com.influxdb.annotations.Measurement
@Measurement(name = "phone-battery") @Measurement(name = "phone-battery")
data class BatteryInfo( data class BatteryInfo(
@Column val percent: Double, @Column val percent: Double, // Percent
@Column val temp: Int, @Column val temperature: Double, // Celsius
@Column val voltage: Int, @Column val voltage: Double, // Volts
@Column val status: String?, @Column val status: String?,
@Column val health: String?, @Column val health: String?,
@Column val powerSource: String?, @Column val powerSource: String?,
@@ -56,8 +56,8 @@ data class BatteryInfo(
return BatteryInfo( return BatteryInfo(
percent = level.toDouble() / scale, percent = level.toDouble() / scale,
temp = temp, temperature = temp / 10.0,
voltage = voltage, voltage = voltage / 1000.0,
status = statusStr, status = statusStr,
health = healthStr, health = healthStr,
powerSource = powerSource powerSource = powerSource