[FL-3052] WS: add choice fahrenheit/celsius (#2149)

* WS: add choice fahrenheit/celsius
* WS: fix syntax

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Skorpionm
2022-12-19 23:22:57 +04:00
committed by GitHub
parent 84ba2690a5
commit a81a5ca57c
6 changed files with 32 additions and 17 deletions

View File

@@ -134,8 +134,8 @@ static void ws_protocol_ambient_weather_remote_controller(WSBlockGeneric* instan
instance->id = (instance->data >> 32) & 0xFF;
instance->battery_low = (instance->data >> 31) & 1;
instance->channel = ((instance->data >> 28) & 0x07) + 1;
instance->temp = ws_block_generic_fahrenheit_to_celsius(
((float)((instance->data >> 16) & 0x0FFF) - 400.0f) / 10.0f);
instance->temp =
locale_fahrenheit_to_celsius(((float)((instance->data >> 16) & 0x0FFF) - 400.0f) / 10.0f);
instance->humidity = (instance->data >> 8) & 0xFF;
instance->btn = WS_NO_BTN;