From acb2f6e1d93ce3e9b35e5ce407ad40b3b103ce0c Mon Sep 17 00:00:00 2001 From: jaymemaurice <38895319+jaymemaurice@users.noreply.github.com> Date: Thu, 11 Feb 2021 16:20:26 -0500 Subject: [PATCH] Fix loss of precision Fix loss of precision regression --- tasmota/xdrv_16_tuyamcu.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasmota/xdrv_16_tuyamcu.ino b/tasmota/xdrv_16_tuyamcu.ino index 2f4c17c1c..579a85234 100644 --- a/tasmota/xdrv_16_tuyamcu.ino +++ b/tasmota/xdrv_16_tuyamcu.ino @@ -323,16 +323,17 @@ float TuyaAdjustedTemperature(uint8_t packetValue, uint8_t res) switch (res) { case 1: - return packetValue/10; + return (float)packetValue / 10; break; case 2: - return packetValue/100; + return (float)packetValue / 100; break; case 3: - return packetValue/1000; + return (float)packetValue / 1000; break; default: return (float)packetValue; + break; } } /*********************************************************************************************\