mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-13 19:27:33 +01:00
Fixed PineTime WeatherSpec handling
This commit is contained in:
parent
1c93ffc3e5
commit
091fd07c7b
@ -42,14 +42,14 @@ public class WeatherSpec implements Parcelable, Serializable {
|
|||||||
private static final long serialVersionUID = VERSION;
|
private static final long serialVersionUID = VERSION;
|
||||||
public int timestamp;
|
public int timestamp;
|
||||||
public String location;
|
public String location;
|
||||||
public int currentTemp;
|
public int currentTemp; // kelvin
|
||||||
public int currentConditionCode = 3200;
|
public int currentConditionCode = 3200;
|
||||||
public String currentCondition;
|
public String currentCondition;
|
||||||
public int currentHumidity;
|
public int currentHumidity;
|
||||||
public int todayMaxTemp;
|
public int todayMaxTemp; // kelvin
|
||||||
public int todayMinTemp;
|
public int todayMinTemp; // kelvin
|
||||||
public float windSpeed; //km per hour
|
public float windSpeed; // km per hour
|
||||||
public int windDirection; //deg
|
public int windDirection; // deg
|
||||||
|
|
||||||
public ArrayList<Forecast> forecasts = new ArrayList<>();
|
public ArrayList<Forecast> forecasts = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -736,7 +736,7 @@ public class PineTimeJFSupport extends AbstractBTLEDeviceSupport implements DfuL
|
|||||||
.put("Timestamp", System.currentTimeMillis() / 1000L)
|
.put("Timestamp", System.currentTimeMillis() / 1000L)
|
||||||
.put("Expires", 60 * 6) // 6h this should be the weather provider's interval, really
|
.put("Expires", 60 * 6) // 6h this should be the weather provider's interval, really
|
||||||
.put("EventType", WeatherData.EventType.Temperature.value)
|
.put("EventType", WeatherData.EventType.Temperature.value)
|
||||||
.put("Temperature", (int) (weatherSpec.currentTemp * 100))
|
.put("Temperature", (int) ((weatherSpec.currentTemp - 273.15) * 100))
|
||||||
.put("DewPoint", (int) (-32768))
|
.put("DewPoint", (int) (-32768))
|
||||||
.end()
|
.end()
|
||||||
.build()
|
.build()
|
||||||
@ -763,7 +763,7 @@ public class PineTimeJFSupport extends AbstractBTLEDeviceSupport implements DfuL
|
|||||||
.put("Timestamp", System.currentTimeMillis() / 1000L)
|
.put("Timestamp", System.currentTimeMillis() / 1000L)
|
||||||
.put("Expires", 60 * 60 * 24) // 24h, because the temperature is today's
|
.put("Expires", 60 * 60 * 24) // 24h, because the temperature is today's
|
||||||
.put("EventType", WeatherData.EventType.Temperature.value)
|
.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))
|
.put("DewPoint", (int) (-32768))
|
||||||
.end()
|
.end()
|
||||||
.build()
|
.build()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user