Skip to content

Commit 2e7c86e

Browse files
bug fix re-assigning to constant variable (#191)
1 parent 887b471 commit 2e7c86e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/switchbot-advertising.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ class SwitchbotAdvertising {
201201

202202
const temp_sign = byte4 & 0b10000000 ? 1 : -1;
203203
const temp_c = temp_sign * ((byte4 & 0b01111111) + (byte3 & 0b00001111) / 10);
204-
const temp_f = (temp_c * 9 / 5) + 32;
205-
temp_f = Math.round(temp_f * 10) / 10;
204+
const temp_f = Math.round(((temp_c * 9 / 5) + 32) * 10) / 10;
206205

207206
const data = {
208207
model: "T",

0 commit comments

Comments
 (0)