From fb224d9e7d379c802a0448af985bbe37e186f794 Mon Sep 17 00:00:00 2001 From: Gilberto Robles Date: Thu, 7 Mar 2024 21:24:45 +0000 Subject: [PATCH] tesla-control: fix climate-set-temp command wrong conversion equation --- cmd/tesla-control/commands.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/tesla-control/commands.go b/cmd/tesla-control/commands.go index b9d6344..1baa784 100644 --- a/cmd/tesla-control/commands.go +++ b/cmd/tesla-control/commands.go @@ -216,7 +216,7 @@ var commands = map[string]*Command{ return fmt.Errorf("failed to parse temperature: format as 22C or 72F") } if unit == "F" || unit == "f" { - degrees = (5.0 * degrees / 9.0) + 32.0 + degrees = (degrees - 32.0) * 5.0 / 9.0 } else if unit != "C" && unit != "c" { return fmt.Errorf("temperature units must be C or F") }