From 86628c9f5e5ef2cf5692f47eb45e3902ed9098fe Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 2 Dec 2021 14:02:22 +0100 Subject: [PATCH] Fix negative temperatures in NRF24 Fix negative temperatures in NRF24 (#13894) --- tasmota/xsns_61_MI_NRF24.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xsns_61_MI_NRF24.ino b/tasmota/xsns_61_MI_NRF24.ino index 2dd3b90e4..f5f61e4e3 100644 --- a/tasmota/xsns_61_MI_NRF24.ino +++ b/tasmota/xsns_61_MI_NRF24.ino @@ -1438,7 +1438,7 @@ void MINRFhandleATCPacket(void){ // AddLog(LOG_LEVEL_INFO,PSTR("NRF: ATC: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x"),MINRF.buffer.raw[0],MINRF.buffer.raw[1],MINRF.buffer.raw[2],MINRF.buffer.raw[3],MINRF.buffer.raw[4],MINRF.buffer.raw[5],MINRF.buffer.raw[6],MINRF.buffer.raw[7],MINRF.buffer.raw[8],MINRF.buffer.raw[9],MINRF.buffer.raw[10],MINRF.buffer.raw[11]); if(_slot==0xff) return; - MIBLEsensors[_slot].temp = (float)(__builtin_bswap16(_packet->temp))/10.0f; + MIBLEsensors[_slot].temp = (float)(int16_t(__builtin_bswap16(_packet->temp)))/10.0f; MIBLEsensors[_slot].hum = (float)_packet->hum; MIBLEsensors[_slot].bat = _packet->batPer; MIBLEsensors[_slot].eventType.tempHum = 1;