mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 13:16:32 +00:00
Update xdrv_16_tuyamcu.ino
Change type uint8_t to uint16_t on TuyaAdjustedTemperature to support temperatures over 25.5 or 255 degrees.
This commit is contained in:
parent
acb2f6e1d9
commit
e6757fed3d
@ -318,18 +318,18 @@ int StrCmpNoCase(char const *Str1, char const *Str2) // Compare case sensistive
|
||||
}
|
||||
}
|
||||
|
||||
float TuyaAdjustedTemperature(uint8_t packetValue, uint8_t res)
|
||||
float TuyaAdjustedTemperature(uint16_t packetValue, uint8_t res)
|
||||
{
|
||||
switch (res)
|
||||
{
|
||||
case 1:
|
||||
return (float)packetValue / 10;
|
||||
return (float)packetValue / 10.0;
|
||||
break;
|
||||
case 2:
|
||||
return (float)packetValue / 100;
|
||||
return (float)packetValue / 100.0;
|
||||
break;
|
||||
case 3:
|
||||
return (float)packetValue / 1000;
|
||||
return (float)packetValue / 1000.0;
|
||||
break;
|
||||
default:
|
||||
return (float)packetValue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user