diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/WeatherSpec.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/WeatherSpec.java index e10aa46b3..88d0e95ee 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/WeatherSpec.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/WeatherSpec.java @@ -42,14 +42,14 @@ public class WeatherSpec implements Parcelable, Serializable { private static final long serialVersionUID = VERSION; public int timestamp; public String location; - public int currentTemp; + public int currentTemp; // kelvin public int currentConditionCode = 3200; public String currentCondition; public int currentHumidity; - public int todayMaxTemp; - public int todayMinTemp; - public float windSpeed; //km per hour - public int windDirection; //deg + public int todayMaxTemp; // kelvin + public int todayMinTemp; // kelvin + public float windSpeed; // km per hour + public int windDirection; // deg public ArrayList forecasts = new ArrayList<>(); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pinetime/PineTimeJFSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pinetime/PineTimeJFSupport.java index 1884c0d3c..58473fb37 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pinetime/PineTimeJFSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pinetime/PineTimeJFSupport.java @@ -736,7 +736,7 @@ public class PineTimeJFSupport extends AbstractBTLEDeviceSupport implements DfuL .put("Timestamp", System.currentTimeMillis() / 1000L) .put("Expires", 60 * 6) // 6h this should be the weather provider's interval, really .put("EventType", WeatherData.EventType.Temperature.value) - .put("Temperature", (int) (weatherSpec.currentTemp * 100)) + .put("Temperature", (int) ((weatherSpec.currentTemp - 273.15) * 100)) .put("DewPoint", (int) (-32768)) .end() .build() @@ -763,7 +763,7 @@ public class PineTimeJFSupport extends AbstractBTLEDeviceSupport implements DfuL .put("Timestamp", System.currentTimeMillis() / 1000L) .put("Expires", 60 * 60 * 24) // 24h, because the temperature is today's .put("EventType", WeatherData.EventType.Temperature.value) - .put("Temperature", (int) (((weatherSpec.todayMinTemp + weatherSpec.todayMaxTemp) / 2) * 100)) + .put("Temperature", (int) ((((weatherSpec.todayMinTemp - 273.15) + (weatherSpec.todayMaxTemp - 273.15)) / 2) * 100)) .put("DewPoint", (int) (-32768)) .end() .build()