Fix Gadgetbridge WeatherSpec (Timestamp and temperature) #3

Closed
ashimokawa wants to merge 2 commits from <deleted>:fix-gadgetbridge-weatherspec into master
1 changed files with 6 additions and 6 deletions

View File

@ -44,19 +44,19 @@ public class GadgetbridgeAPI {
weatherSpec = new WeatherSpec();
weatherSpec.currentConditionCode = currentWeatherCondition;
weatherSpec.currentCondition = new WeatherCodeContract(weatherCard,0).getWeatherConditionText(context,currentWeatherCondition);
weatherSpec.currentTemp = (int) (weatherCard.getCurrentTemp());
weatherSpec.currentTemp = (int) (weatherCard.getCurrentTemp()) + 273;
weatherSpec.location = weatherCard.getName();
weatherSpec.timestamp = (int) weatherCard.polling_time / 1000;
weatherSpec.todayMaxTemp = weatherCard.todaysHigh();
weatherSpec.todayMinTemp = weatherCard.todaysLow();
weatherSpec.timestamp = (int) (weatherCard.polling_time / 1000);
weatherSpec.todayMaxTemp = weatherCard.todaysHigh() + 273;
weatherSpec.todayMinTemp = weatherCard.todaysLow() + 273;
weatherSpec.windSpeed = (float) weatherCard.getCurrentWindSpeed();
weatherSpec.windDirection = (int) weatherCard.getCurrentWindDirection();
// build the forecast instance
WeatherCodeContract weatherCodeContract = new WeatherCodeContract(weatherCard,WeatherCodeContract.WEATHER_24H);
weatherCodeContract.setLineageOsCompatible(true);
int forecastCondition = weatherCodeContract.getWeatherCondition();
WeatherSpec.Forecast forecast = new WeatherSpec.Forecast((int) weatherCard.get24hLow(),
(int) weatherCard.get24hLow(),
WeatherSpec.Forecast forecast = new WeatherSpec.Forecast((int) weatherCard.get24hLow() + 273,
(int) weatherCard.get24hLow() + 273,
forecastCondition,
0);
weatherSpec.forecasts.add(forecast);