QML sets temp to 15~30 and this binding convert it to 0x10~0xF0
Change-Id: I027853e2279ff8b9a5e4a169bf7a7f549cf73a1e
Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
// Get original get temperature function from cpp hvacplugin code
static uint8_t to_can_temp(uint8_t value)
{
// Get original get temperature function from cpp hvacplugin code
static uint8_t to_can_temp(uint8_t value)
{
- int result = ((0xF0 - 0x10) / 15) * value - 16;
+ int result = ((0xF0 - 0x10) / 15) * (value - 15) + 0x10;
if (result < 0x10)
result = 0x10;
if (result > 0xF0)
if (result < 0x10)
result = 0x10;
if (result > 0xF0)