Huawei: round speed and uvIndex values

This commit is contained in:
Me7c7
2025-10-03 11:25:50 +03:00
parent 597dc7b1ad
commit f870704983
3 changed files with 3 additions and 3 deletions
@@ -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)
@@ -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) {
@@ -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);
}