Enhance documentation for API client and vehicle structures; improve test function naming for clarity
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 24s
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 24s
This commit is contained in:
36
vehicle.go
36
vehicle.go
@ -36,7 +36,7 @@ import (
|
||||
// },
|
||||
// }
|
||||
|
||||
// Vehicle .
|
||||
// Vehicle represents a Subaru vehicle with various attributes and methods to interact with it.
|
||||
type Vehicle struct {
|
||||
CarId int64
|
||||
Vin string // SELECT CAR REQUEST > "vin": "4S4BTGND8L3137058"
|
||||
@ -88,7 +88,7 @@ type Vehicle struct {
|
||||
|
||||
}
|
||||
|
||||
// ClimateProfile .
|
||||
// ClimateProfile represents a climate control profile for a Subaru vehicle.
|
||||
type ClimateProfile struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
VehicleType string `json:"vehicleType,omitempty"` // vehicleType [ gas | phev ]
|
||||
@ -107,7 +107,7 @@ type ClimateProfile struct {
|
||||
StartConfiguration string `json:"startConfiguration"` // startConfiguration [ START_ENGINE_ALLOW_KEY_IN_IGNITION (gas) | START_CLIMATE_CONTROL_ONLY_ALLOW_KEY_IN_IGNITION (phev) ]
|
||||
}
|
||||
|
||||
// GeoLocation .
|
||||
// GeoLocation represents the geographical location of a Subaru vehicle.
|
||||
type GeoLocation struct {
|
||||
Latitude float64 // 40.700184
|
||||
Longitude float64 // -74.401375
|
||||
@ -116,7 +116,7 @@ type GeoLocation struct {
|
||||
Updated time.Time
|
||||
}
|
||||
|
||||
// Door .
|
||||
// Door represents a door of a Subaru vehicle with its position, sub-position, status, and lock state.
|
||||
type Door struct {
|
||||
Position string // front | rear | boot | enginehood
|
||||
SubPosition string // right | left
|
||||
@ -125,7 +125,7 @@ type Door struct {
|
||||
Updated time.Time
|
||||
}
|
||||
|
||||
// Window .
|
||||
// Window represents a window of a Subaru vehicle with its position, sub-position, status, and last updated time.
|
||||
type Window struct {
|
||||
Position string
|
||||
SubPosition string
|
||||
@ -133,7 +133,7 @@ type Window struct {
|
||||
Updated time.Time
|
||||
}
|
||||
|
||||
// Tire .
|
||||
// Tire represents a tire of a Subaru vehicle with its position, sub-position, pressure, pressure in PSI, and last updated time.
|
||||
type Tire struct {
|
||||
Position string
|
||||
SubPosition string
|
||||
@ -143,7 +143,7 @@ type Tire struct {
|
||||
// Status string
|
||||
}
|
||||
|
||||
// Trouble .
|
||||
// Trouble represents a trouble or issue with a Subaru vehicle, containing a description of the trouble.
|
||||
type Trouble struct {
|
||||
Description string
|
||||
}
|
||||
@ -211,7 +211,7 @@ func (v *Vehicle) String() string {
|
||||
return vString
|
||||
}
|
||||
|
||||
// Lock .
|
||||
// Lock
|
||||
// Sends a command to lock doors.
|
||||
func (v *Vehicle) Lock() (chan string, error) {
|
||||
if !v.getRemoteOptionsStatus() {
|
||||
@ -235,7 +235,7 @@ func (v *Vehicle) Lock() (chan string, error) {
|
||||
return ch, nil
|
||||
}
|
||||
|
||||
// Unlock .
|
||||
// Unlock
|
||||
// Send command to unlock doors.
|
||||
func (v *Vehicle) Unlock() (chan string, error) {
|
||||
if !v.getRemoteOptionsStatus() {
|
||||
@ -259,7 +259,7 @@ func (v *Vehicle) Unlock() (chan string, error) {
|
||||
return ch, nil
|
||||
}
|
||||
|
||||
// EngineStart .
|
||||
// EngineStart
|
||||
// Sends a command to start engine and set climate control.
|
||||
func (v *Vehicle) EngineStart() (chan string, error) {
|
||||
if !v.getRemoteOptionsStatus() {
|
||||
@ -296,7 +296,7 @@ func (v *Vehicle) EngineStart() (chan string, error) {
|
||||
return ch, nil
|
||||
}
|
||||
|
||||
// EngineStop .
|
||||
// EngineStop
|
||||
// Sends a command to stop engine.
|
||||
func (v *Vehicle) EngineStop() (chan string, error) {
|
||||
if !v.getRemoteOptionsStatus() {
|
||||
@ -320,7 +320,7 @@ func (v *Vehicle) EngineStop() (chan string, error) {
|
||||
return ch, nil
|
||||
}
|
||||
|
||||
// LightsStart .
|
||||
// LightsStart
|
||||
// Sends a command to flash lights.
|
||||
func (v *Vehicle) LightsStart() (chan string, error) {
|
||||
if !v.getRemoteOptionsStatus() {
|
||||
@ -345,7 +345,7 @@ func (v *Vehicle) LightsStart() (chan string, error) {
|
||||
return ch, nil
|
||||
}
|
||||
|
||||
// LightsStop .
|
||||
// LightsStop
|
||||
// Sends a command to stop flash lights.
|
||||
func (v *Vehicle) LightsStop() (chan string, error) {
|
||||
if !v.getRemoteOptionsStatus() {
|
||||
@ -371,7 +371,7 @@ func (v *Vehicle) LightsStop() (chan string, error) {
|
||||
return ch, nil
|
||||
}
|
||||
|
||||
// HornStart .
|
||||
// HornStart
|
||||
// Send command to sound horn.
|
||||
func (v *Vehicle) HornStart() (chan string, error) {
|
||||
if !v.getRemoteOptionsStatus() {
|
||||
@ -397,7 +397,7 @@ func (v *Vehicle) HornStart() (chan string, error) {
|
||||
return ch, nil
|
||||
}
|
||||
|
||||
// HornStop .
|
||||
// HornStop
|
||||
// Send command to sound horn.
|
||||
func (v *Vehicle) HornStop() (chan string, error) {
|
||||
if !v.getRemoteOptionsStatus() {
|
||||
@ -423,7 +423,7 @@ func (v *Vehicle) HornStop() (chan string, error) {
|
||||
return ch, nil
|
||||
}
|
||||
|
||||
// ChargeStart .
|
||||
// ChargeStart
|
||||
func (v *Vehicle) ChargeOn() (chan string, error) {
|
||||
if !v.getRemoteOptionsStatus() {
|
||||
v.client.logger.Error(APP_ERRORS["SUBSCRIBTION_REQUIRED"])
|
||||
@ -447,7 +447,7 @@ func (v *Vehicle) ChargeOn() (chan string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// GetLocation .
|
||||
// GetLocation
|
||||
func (v *Vehicle) GetLocation(force bool) (chan string, error) {
|
||||
if !v.getRemoteOptionsStatus() {
|
||||
v.client.logger.Error(APP_ERRORS["SUBSCRIBTION_REQUIRED"])
|
||||
@ -580,7 +580,7 @@ func (v *Vehicle) GetClimateQuickPresets() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetClimateUserPresets .
|
||||
// GetClimateUserPresets
|
||||
func (v *Vehicle) GetClimateUserPresets() error {
|
||||
if !v.getRemoteOptionsStatus() {
|
||||
v.client.logger.Error(APP_ERRORS["SUBSCRIBTION_REQUIRED"])
|
||||
|
Reference in New Issue
Block a user