Skip to content

Commit

Permalink
[mibandservice] fix weather precision
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlich committed Dec 24, 2023
1 parent f969c2c commit 9ffd6c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions daemon/src/services/mibandservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ void MiBandService::sendWeather(const CurrentWeather *weather, bool supportsCond
QBuffer buffer(&buf);
buffer.open(QIODevice::WriteOnly);

char temp = weather->temperature() - 273;
char temp = weather->temperature() - 273.15;
qint32 dt = qToLittleEndian(weather->dateTime());

qDebug() << dt << temp << condition;
Expand Down Expand Up @@ -830,8 +830,8 @@ void MiBandService::sendWeather(const CurrentWeather *weather, bool supportsCond
buffer.putChar(NR_DAYS);
buffer.putChar(condition);
buffer.putChar(condition);
buffer.putChar((char) (weather->maxTemperature() - 273));
buffer.putChar((char) (weather->minTemperature() - 273));
buffer.putChar((char) (weather->maxTemperature() - 273.15));
buffer.putChar((char) (weather->minTemperature() - 273.15));
if (supportsConditionString) {
buffer.write(weather->description().toLatin1());
buffer.putChar((char)0x00);
Expand All @@ -845,8 +845,8 @@ void MiBandService::sendWeather(const CurrentWeather *weather, bool supportsCond

buffer.putChar(condition);
buffer.putChar(condition);
buffer.putChar((char) (fc.maxTemperature() - 273));
buffer.putChar((char) (fc.minTemperature() - 273));
buffer.putChar((char) (fc.maxTemperature() - 273.15));
buffer.putChar((char) (fc.minTemperature() - 273.15));

if (supportsConditionString) {
buffer.write(fc.description().toLatin1());
Expand Down

0 comments on commit 9ffd6c0

Please sign in to comment.