mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Huawei: round speed and uvIndex values
This commit is contained in:
+1
-1
@@ -344,7 +344,7 @@ public class Weather {
|
||||
if (sourceName != null && settings.sourceSupported)
|
||||
this.tlv.put(0x0e, sourceName);
|
||||
if (uvIndex != null && settings.uvIndexSupported)
|
||||
this.tlv.put(0x0f, uvIndex.byteValue());
|
||||
this.tlv.put(0x0f, (byte)Math.round(uvIndex));
|
||||
|
||||
if(settings.extendedHourlyForecast) {
|
||||
if(humidity != null)
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public class SendWeatherCurrentRequest extends Request {
|
||||
weatherSpec.getUvIndex(),
|
||||
"Gadgetbridge",
|
||||
(byte) weatherSpec.getCurrentHumidity(),
|
||||
(int) weatherSpec.getWindSpeed(),
|
||||
Math.round(weatherSpec.getWindSpeed()),
|
||||
(weatherSpec.getFeelsLikeTemp() - 273)
|
||||
).serialize();
|
||||
} catch (HuaweiPacket.CryptoException e) {
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ public class SendWeatherForecastRequest extends Request {
|
||||
timeData.icon = supportProvider.openWeatherMapConditionCodeToHuaweiIcon(hourly.getConditionCode());
|
||||
timeData.temperature = (byte) (hourly.getTemp() - 273);
|
||||
timeData.precipitation = (byte) hourly.getPrecipProbability();
|
||||
timeData.uvIndex = (byte) hourly.getUvIndex();
|
||||
timeData.uvIndex = (byte) Math.round(hourly.getUvIndex());
|
||||
timeDataArrayList.add(timeData);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user