Browse Source

Fixed bugs with Climate

ui_file
Gregory Rudolph 4 years ago
parent
commit
9a36e6d209
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 14
      main.go

14
main.go

@ -5,7 +5,6 @@ import (
"os" "os"
"strconv" "strconv"
"strings" "strings"
"time"
"github.com/bogosj/tesla" "github.com/bogosj/tesla"
"github.com/therecipe/qt/widgets" "github.com/therecipe/qt/widgets"
@ -274,16 +273,17 @@ func enableClimate(i int) {
if err != nil { if err != nil {
showDialogue("Unable to parse temp setting\n%+v", err) showDialogue("Unable to parse temp setting\n%+v", err)
} }
if guiSettings.GuiTemperatureUnits == "F" {
temp = (temp - 32) * 5 / 9
}
if i == 0 { if i == 0 {
vehicle.StopAirConditioning() vehicle.StopAirConditioning()
} else { } else {
vehicle.SetTemperature(temp, temp) vehicle.SetTemperature(temp, temp)
vehicle.StartAirConditioning() vehicle.StartAirConditioning()
} }
go func() {
time.Sleep(1 * time.Minute) go setValues()
setValues()
}()
} }
func lockDoors(i int) { func lockDoors(i int) {
@ -296,11 +296,7 @@ func lockDoors(i int) {
} }
func sentryModeEnable(i int) { func sentryModeEnable(i int) {
if i == 0 {
showDialogue("Unable to disable sentry mode.\nUnsupported.")
} else {
vehicle.EnableSentry() vehicle.EnableSentry()
}
go setValues() go setValues()
} }

Loading…
Cancel
Save