From 9a36e6d209c92bcb63d41a553f25392eb75d9b1d Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Tue, 13 Jul 2021 16:29:06 -0400 Subject: [PATCH] Fixed bugs with Climate --- main.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index f5f1b35..c07b089 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,6 @@ import ( "os" "strconv" "strings" - "time" "github.com/bogosj/tesla" "github.com/therecipe/qt/widgets" @@ -274,16 +273,17 @@ func enableClimate(i int) { if err != nil { showDialogue("Unable to parse temp setting\n%+v", err) } + if guiSettings.GuiTemperatureUnits == "F" { + temp = (temp - 32) * 5 / 9 + } if i == 0 { vehicle.StopAirConditioning() } else { vehicle.SetTemperature(temp, temp) vehicle.StartAirConditioning() } - go func() { - time.Sleep(1 * time.Minute) - setValues() - }() + + go setValues() } func lockDoors(i int) { @@ -296,11 +296,7 @@ func lockDoors(i int) { } func sentryModeEnable(i int) { - if i == 0 { - showDialogue("Unable to disable sentry mode.\nUnsupported.") - } else { - vehicle.EnableSentry() - } + vehicle.EnableSentry() go setValues() }