From 143d100793020694ffff27318f44130dbc740b4a Mon Sep 17 00:00:00 2001 From: Alex Savin Date: Tue, 22 Jul 2025 16:56:11 -0400 Subject: [PATCH] Update go.mod to use latest mysubaru module version and update net dependency --- example/example.go | 70 ++++++++++++++++++++++++++++------------------ example/go.mod | 4 +-- 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/example/example.go b/example/example.go index 41a1c21..feb1296 100644 --- a/example/example.go +++ b/example/example.go @@ -30,8 +30,6 @@ func main() { os.Exit(1) } - // subaru := ms.SelectVehicle("4S4BTGPD0P3199198") - // 11.6MMAN ABS_MIL ACCS AHBL_MIL ATF_MIL AWD_MIL BSD BSDRCT_MIL CEL_MIL EBD_MIL EOL_MIL EPAS_MIL EPB_MIL ESS_MIL EYESIGHT ISS_MIL NAV_TOMTOM OPL_MIL RAB_MIL RCC REARBRK RES RESCC RHSF RPOI RPOIA SRS_MIL TEL_MIL TIF_35 TIR_33 TPMS_MIL VDC_MIL WASH_MIL g2 // subaru1 := mysubaru.GetVehicleByVIN("4S4BTGND8L3137058") // fmt.Printf("SUBARU #2 (Vehicle Status):\n") @@ -47,54 +45,65 @@ func main() { cfg.Logger.Error("cannot get a vehicle by VIN", "error", err) os.Exit(1) } + fmt.Printf("SUBARU #1 (Vehicle Status): %s\n", outback) - // // Execute a LightsStart command - // events, err := outback.LightsStart() + // // Execute a Lock command + // events, err := outback.EngineStart(5, 0, true) // if err != nil { - // cfg.Logger.Error("cannot execute LightsStart command", "error", err) + // cfg.Logger.Error("cannot execute Lock command", "error", err) // os.Exit(1) // } // for event := range events { - // fmt.Printf("Lights Start Event: %+v\n", event) + // fmt.Printf("Lock Event: %+v\n", event) // } - // // Wait for a while to see the lights on - // time.Sleep(20 * time.Second) - - // // Execute a LightsStop command - // events, err = outback.LightsStop() - // if err != nil { - // cfg.Logger.Error("cannot execute LightsStop command", "error", err) - // os.Exit(1) - // } - // for event := range events { - // fmt.Printf("Lights Stop Event: %+v\n", event) - // } - - // Execute a Unlock command - events, err := outback.Unlock() + // Execute a LightsStart command + events, err := outback.LightsStart() if err != nil { - cfg.Logger.Error("cannot execute Unlock command", "error", err) + cfg.Logger.Error("cannot execute LightsStart command", "error", err) os.Exit(1) } for event := range events { - fmt.Printf("Unlock Event: %+v\n", event) + fmt.Printf("Lights Start Event: %+v\n", event) } // Wait for a while to see the lights on time.Sleep(20 * time.Second) - // Execute a Lock command - events, err = outback.Lock() + // Execute a LightsStop command + events, err = outback.LightsStop() if err != nil { - cfg.Logger.Error("cannot execute Lock command", "error", err) + cfg.Logger.Error("cannot execute LightsStop command", "error", err) os.Exit(1) } for event := range events { - fmt.Printf("Lock Event: %+v\n", event) + fmt.Printf("Lights Stop Event: %+v\n", event) } + // // Execute a Unlock command + // events, err := outback.Unlock() + // if err != nil { + // cfg.Logger.Error("cannot execute Unlock command", "error", err) + // os.Exit(1) + // } + // for event := range events { + // fmt.Printf("Unlock Event: %+v\n", event) + // } + + // // Wait for a while to see the lights on + // time.Sleep(20 * time.Second) + + // // Execute a Lock command + // events, err = outback.Lock() + // if err != nil { + // cfg.Logger.Error("cannot execute Lock command", "error", err) + // os.Exit(1) + // } + // for event := range events { + // fmt.Printf("Lock Event: %+v\n", event) + // } + // Execute a forced GetLocation command // events, err = outback.GetLocation(true) // if err != nil { @@ -105,3 +114,10 @@ func main() { // fmt.Printf("GeoLocation Event: %+v\n", event) // } } + +// {"time":"2025-07-21T18:05:30.987314-04:00","level":"DEBUG","source":{"function":"git.savin.nyc/alex/mysubaru.(*Client).execute","file":"/Users/alex/go/pkg/mod/git.savin.nyc/alex/mysubaru@v0.0.0-20250721200300-3809ed5883b4/client.go","line":372},"msg":"executed GET request","method":"GET","url":"/g2v31/service/g2/remoteEngineQuickStartSettings/fetch.json","params":{}} +// {"time":"2025-07-21T18:05:31.014014-04:00","level":"DEBUG","source":{"function":"git.savin.nyc/alex/mysubaru.(*Client).execute","file":"/Users/alex/go/pkg/mod/git.savin.nyc/alex/mysubaru@v0.0.0-20250721200300-3809ed5883b4/client.go","line":404},"msg":"parsed http request output","data":"{\"success\":true,\"errorCode\":null,\"dataName\":null,\"data\":\"{\\\"name\\\":\\\"Cooling\\\",\\\"runTimeMinutes\\\":\\\"10\\\",\\\"climateZoneFrontTemp\\\":\\\"65\\\",\\\"climateZoneFrontAirMode\\\":\\\"FEET_FACE_BALANCED\\\",\\\"climateZoneFrontAirVolume\\\":\\\"7\\\",\\\"outerAirCirculation\\\":\\\"outsideAir\\\",\\\"heatedRearWindowActive\\\":\\\"false\\\",\\\"heatedSeatFrontLeft\\\":\\\"HIGH_COOL\\\",\\\"heatedSeatFrontRight\\\":\\\"HIGH_COOL\\\",\\\"airConditionOn\\\":\\\"false\\\",\\\"canEdit\\\":\\\"true\\\",\\\"disabled\\\":\\\"false\\\",\\\"presetType\\\":\\\"userPreset\\\",\\\"startConfiguration\\\":\\\"START_ENGINE_ALLOW_KEY_IN_IGNITION\\\"}\"}"} + +// {"time":"2025-07-21T18:03:44.461646-04:00","level":"DEBUG","source":{"function":"git.savin.nyc/alex/mysubaru.(*Client).execute","file":"/Users/alex/go/pkg/mod/git.savin.nyc/alex/mysubaru@v0.0.0-20250721200300-3809ed5883b4/client.go","line":372},"msg":"executed GET request","method":"GET","url":"/g2v31/service/g2/remoteEngineQuickStartSettings/fetch.json","params":{}} +// {"time":"2025-07-21T18:03:44.475745-04:00","level":"DEBUG","source":{"function":"git.savin.nyc/alex/mysubaru.(*Client).execute","file":"/Users/alex/go/pkg/mod/git.savin.nyc/alex/mysubaru@v0.0.0-20250721200300-3809ed5883b4/client.go","line":404},"msg":"parsed http request output","data":"{\"success\":true,\"errorCode\":null,\"dataName\":null,\"data\":\"{\\\"airConditionOn\\\":\\\"false\\\",\\\"climateSettings\\\":\\\"climateSettings\\\",\\\"climateZoneFrontAirMode\\\":\\\"FEET_WINDOW\\\",\\\"climateZoneFrontAirVolume\\\":\\\"7\\\",\\\"climateZoneFrontTemp\\\":\\\"65\\\",\\\"heatedRearWindowActive\\\":\\\"false\\\",\\\"heatedSeatFrontLeft\\\":\\\"HIGH_COOL\\\",\\\"heatedSeatFrontRight\\\":\\\"HIGH_COOL\\\",\\\"name\\\":\\\"Cooling\\\",\\\"outerAirCirculation\\\":\\\"outsideAir\\\",\\\"runTimeMinutes\\\":\\\"10\\\",\\\"startConfiguration\\\":\\\"START_ENGINE_ALLOW_KEY_IN_IGNITION\\\"}\\n\"}"} +// {"time":"2025-07-21T18:03:44.475885-04:00","level":"ERROR","source":{"function":"git.savin.nyc/alex/mysubaru.(*Vehicle).GetClimateQuickPresets","file":"/Users/alex/go/pkg/mod/git.savin.nyc/alex/mysubaru@v0.0.0-20250721200300-3809ed5883b4/vehicle.go","line":498},"msg":"error while parsing climate quick presets json","request":"GetClimateQuickPresets","error":"invalid character '\"' after top-level value"} diff --git a/example/go.mod b/example/go.mod index 08da180..92c30b8 100644 --- a/example/go.mod +++ b/example/go.mod @@ -2,12 +2,12 @@ module example go 1.24 -require git.savin.nyc/alex/mysubaru v0.0.0-20250706191512-3c927fd83b1f +require git.savin.nyc/alex/mysubaru v0.0.0-20250722205404-92d4266f8b5a require ( github.com/kr/text v0.2.0 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect - golang.org/x/net v0.41.0 // indirect + golang.org/x/net v0.42.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect resty.dev/v3 v3.0.0-beta.3 // indirect )