Alex Savin 07e3005e9c
Some checks failed
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Failing after 24s
Remove session validation checks from vehicle selection and contact methods
2025-07-08 16:42:39 -04:00
2025-05-20 15:54:30 -04:00

MySubaru!GO

Is a simple API client to interact with My Subaru service (https://www.mysubaru.com/) via HTTP, written in Go

News

  • v0.0.0-dev First public release on April 11, 2023

Features

  • Simple and chainable methods for settings and request

Installation

# Go Modules
go get git.savin.nyc/alex/mysubaru

Usage

The following samples will assist you to become as comfortable as possible with mysubaru library.

// Import hassky into your code and refer it as `mysubaru`.
import "git.savin.nyc/alex/mysubaru"

Create a new MySubaru API Client

// Create a MySubaru Client
msc, err := mysubaru.New(cfg)
if err != nil {
  cfg.Logger.Error("cannot create MySubaru client", "error", err)
  os.Exit(1)
}

Get a car by VIN

outback, err := msc.GetVehicleByVIN("1HGCM82633A004352")
if err != nil {
  cfg.Logger.Error("cannot get a vehicle by VIN", "error", err)
  os.Exit(1)
}

Start/Stop Lights request

// Execute a LightsStart command
events, err := outback.LightsStart()
if err != nil {
  cfg.Logger.Error("cannot execute LightsStart command", "error", err)
  os.Exit(1)
}
for event := range events {
  fmt.Printf("Lights Start 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)
}
Description
No description provided
Readme 2.1 MiB
Languages
Go 100%