Documentation ¶
Index ¶
- Constants
- type AutoParkRequest
- type ChargeState
- type Client
- func (c *Client) EnergySite(productID int64) (*EnergySite, error)
- func (c *Client) Products() ([]*Product, error)
- func (c *Client) SetApiUrl(url string)
- func (c *Client) SetBaseUrl(url string)
- func (c *Client) UserMe() (*Me, error)
- func (c *Client) UserRegion() (*Region, error)
- func (c *Client) Vehicle(vin string) (*Vehicle, error)
- func (c *Client) Vehicles() ([]*Vehicle, error)
- type ClientOption
- type ClimateState
- type CommandResponse
- type DriveState
- type EnergySite
- type EnergySiteHistory
- type EnergySiteHistoryTimeSeries
- type EnergySiteStatus
- type GuiSettings
- type HistoryPeriod
- type Identifier
- type Me
- type MeResponse
- type MobileEnabledResponse
- type NearbyChargingSitesResponse
- type Product
- type ProductsResponse
- type Region
- type RegionResponse
- type SentryData
- type ServiceData
- type SiteCommandResponse
- type SiteHistoryResponse
- type SiteInfoResponse
- type SiteStatusResponse
- type Vehicle
- func (v *Vehicle) AutoparkAbort() error
- func (v *Vehicle) AutoparkForward() error
- func (v *Vehicle) AutoparkReverse() error
- func (v Vehicle) Data() (*VehicleData, error)
- func (v *Vehicle) EnableSentry() error
- func (v *Vehicle) FlashLights() error
- func (v *Vehicle) HonkHorn() error
- func (v *Vehicle) LockDoors() error
- func (v *Vehicle) MobileEnabled() (bool, error)
- func (v *Vehicle) MovePanoRoof(state string, percent int) error
- func (v *Vehicle) NearbyChargingSites() (*NearbyChargingSitesResponse, error)
- func (v *Vehicle) OpenChargePort() error
- func (v *Vehicle) OpenTrunk(trunk string) error
- func (v *Vehicle) ResetValetPIN() error
- func (v *Vehicle) SetChargeLimit(percent int) error
- func (v *Vehicle) SetChargeLimitMax() error
- func (v *Vehicle) SetChargeLimitStandard() error
- func (v *Vehicle) SetChargingAmps(amps int) error
- func (v *Vehicle) SetSeatHeater(heater int, level int) error
- func (v *Vehicle) SetSteeringWheelHeater(on bool) error
- func (v *Vehicle) SetTemperature(driver float64, passenger float64) error
- func (v *Vehicle) Start(password string) error
- func (v *Vehicle) StartAirConditioning() error
- func (v *Vehicle) StartCharging() error
- func (v *Vehicle) StopAirConditioning() error
- func (v *Vehicle) StopCharging() error
- func (v *Vehicle) TriggerHomelink() error
- func (v *Vehicle) UnlockDoors() error
- func (v *Vehicle) Wakeup() (*Vehicle, error)
- func (v *Vehicle) WindowControl(command string, lat, lon float64) error
- func (v *Vehicle) WithClient(c *Client) *Vehicle
- type VehicleConfig
- type VehicleData
- type VehiclePartialResponse
- type VehicleResponse
- type VehicleState
- type VehiclesResponse
Constants ¶
const ( FleetAudienceNA = "https://fleet-api.prd.na.vn.cloud.tesla.com/" FleetAudienceEU = "https://fleet-api.prd.eu.vn.cloud.tesla.com/" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoParkRequest ¶
type AutoParkRequest struct { VehicleID uint64 `json:"vehicle_id,omitempty"` Lat float64 `json:"lat"` Lon float64 `json:"lon"` Action string `json:"action,omitempty"` }
AutoParkRequest are the required elements to POST an Autopark/Summon request for the vehicle.
type ChargeState ¶
type ChargeState struct { Timestamp timeMsec `json:"timestamp"` ChargingState string `json:"charging_state"` ChargeLimitSoc int `json:"charge_limit_soc"` ChargeLimitSocStd int `json:"charge_limit_soc_std"` ChargeLimitSocMin int `json:"charge_limit_soc_min"` ChargeLimitSocMax int `json:"charge_limit_soc_max"` ChargeToMaxRange bool `json:"charge_to_max_range"` BatteryHeaterOn bool `json:"battery_heater_on"` NotEnoughPowerToHeat bool `json:"not_enough_power_to_heat"` MaxRangeChargeCounter int `json:"max_range_charge_counter"` FastChargerPresent bool `json:"fast_charger_present"` FastChargerType string `json:"fast_charger_type"` BatteryRange float64 `json:"battery_range"` EstBatteryRange float64 `json:"est_battery_range"` IdealBatteryRange float64 `json:"ideal_battery_range"` BatteryLevel int `json:"battery_level"` UsableBatteryLevel int `json:"usable_battery_level"` ChargeEnergyAdded float64 `json:"charge_energy_added"` ChargeMilesAddedRated float64 `json:"charge_miles_added_rated"` ChargeMilesAddedIdeal float64 `json:"charge_miles_added_ideal"` ChargerVoltage int `json:"charger_voltage"` ChargerPilotCurrent int `json:"charger_pilot_current"` ChargerActualCurrent int `json:"charger_actual_current"` ChargerPower int `json:"charger_power"` TimeToFullCharge float64 `json:"time_to_full_charge"` TripCharging bool `json:"trip_charging"` ChargeRate float64 `json:"charge_rate"` ChargePortDoorOpen bool `json:"charge_port_door_open"` MotorizedChargePort bool `json:"motorized_charge_port"` ScheduledChargingMode string `json:"scheduled_charging_mode"` ScheduledDepatureTime interface{} `json:"scheduled_departure_time"` ScheduledChargingStartTime interface{} `json:"scheduled_charging_start_time"` ScheduledChargingPending bool `json:"scheduled_charging_pending"` UserChargeEnableRequest interface{} `json:"user_charge_enable_request"` ChargeEnableRequest bool `json:"charge_enable_request"` EuVehicle bool `json:"eu_vehicle"` ChargerPhases int `json:"charger_phases"` ChargePortLatch string `json:"charge_port_latch"` ChargeCurrentRequest int `json:"charge_current_request"` ChargeCurrentRequestMax int `json:"charge_current_request_max"` ChargeAmps int `json:"charge_amps"` OffPeakChargingEnabled bool `json:"off_peak_charging_enabled"` OffPeakChargingTimes string `json:"off_peak_charging_times"` OffPeakHoursEndTime int `json:"off_peak_hours_end_time"` PreconditioningEnabled bool `json:"preconditioning_enabled"` PreconditioningTimes string `json:"preconditioning_times"` ManagedChargingActive bool `json:"managed_charging_active"` ManagedChargingUserCanceled bool `json:"managed_charging_user_canceled"` ManagedChargingStartTime interface{} `json:"managed_charging_start_time"` ChargePortcoldWeatherMode bool `json:"charge_port_cold_weather_mode"` ConnChargeCable string `json:"conn_charge_cable"` FastChargerBrand string `json:"fast_charger_brand"` MinutesToFullCharge int `json:"minutes_to_full_charge"` }
ChargeState contains the current charge states that exist within the vehicle.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides the client and associated elements for interacting with the Tesla API.
func NewClient ¶
func NewClient(ctx context.Context, options ...ClientOption) (*Client, error)
NewClient creates a new Tesla API client. You must provided one of WithToken or WithTokenFile functional options to initialize the client with an OAuth token.
func (*Client) EnergySite ¶
func (c *Client) EnergySite(productID int64) (*EnergySite, error)
return fetches the energy site for the given product ID
func (*Client) SetApiUrl ¶
Sets new api url. Use after obtaining user's region. It is clients responsibility to append `/api/1` for use with the Fleet API.
func (*Client) SetBaseUrl ¶
Sets new base url. Use after obtaining user's region.
func (*Client) UserRegion ¶
UserRegion fetches the users region
type ClientOption ¶
ClientOption can be passed when creating the client
func WithClient ¶
func WithClient(client *http.Client) ClientOption
WithClient provides set the http.Client
func WithTokenSource ¶
func WithTokenSource(ts oauth2.TokenSource) ClientOption
WithTokenSource provides an oauth2.TokenSource to the client for auth
type ClimateState ¶
type ClimateState struct { Timestamp timeMsec `json:"timestamp"` InsideTemp float64 `json:"inside_temp"` OutsideTemp float64 `json:"outside_temp"` DriverTempSetting float64 `json:"driver_temp_setting"` PassengerTempSetting float64 `json:"passenger_temp_setting"` LeftTempDirection float64 `json:"left_temp_direction"` RightTempDirection float64 `json:"right_temp_direction"` IsAutoConditioningOn bool `json:"is_auto_conditioning_on"` IsFrontDefrosterOn bool `json:"is_front_defroster_on"` IsRearDefrosterOn bool `json:"is_rear_defroster_on"` FanStatus interface{} `json:"fan_status"` IsClimateOn bool `json:"is_climate_on"` MinAvailTemp float64 `json:"min_avail_temp"` MaxAvailTemp float64 `json:"max_avail_temp"` SeatHeaterLeft int `json:"seat_heater_left"` SeatHeaterRight int `json:"seat_heater_right"` SeatHeaterRearLeft int `json:"seat_heater_rear_left"` SeatHeaterRearRight int `json:"seat_heater_rear_right"` SeatHeaterRearCenter int `json:"seat_heater_rear_center"` SeatHeaterRearRightBack int `json:"seat_heater_rear_right_back"` SeatHeaterRearLeftBack int `json:"seat_heater_rear_left_back"` SmartPreconditioning bool `json:"smart_preconditioning"` BatteryHeater bool `json:"battery_heater"` BatteryHeaterNoPower interface{} `json:"battery_heater_no_power"` ClimateKeeperMode string `json:"climate_keeper_mode"` DefrostMode int `json:"defrost_mode"` IsPreconditioning bool `json:"is_preconditioning"` RemoteHeaterControlEnabled bool `json:"remote_heater_control_enabled"` SideMirrorHeaters bool `json:"side_mirror_heaters"` WiperBladeHeater bool `json:"wiper_blade_heater"` }
ClimateState contains the current climate states availale from the vehicle.
type CommandResponse ¶
type CommandResponse struct { Response struct { Reason string `json:"reason"` Result bool `json:"result"` } `json:"response"` Error string `json:"error"` }
CommandResponse is the response from the Tesla API after POSTing a command.
func (*CommandResponse) Reason ¶
func (response *CommandResponse) Reason() error
type DriveState ¶
type DriveState struct { Timestamp timeMsec `json:"timestamp"` ShiftState interface{} `json:"shift_state"` Speed float64 `json:"speed"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` ActiveRouteLatitude float64 `json:"active_route_latitude"` ActiveRouteLongitude float64 `json:"active_route_longitude"` Heading int `json:"heading"` GpsAsOf int64 `json:"gps_as_of"` NativeLatitude float64 `json:"native_latitude"` NativeLocationSupported int `json:"native_location_supported"` NativeLongitude float64 `json:"native_longitude"` NativeType string `json:"native_type"` Power int `json:"power"` }
DriveState contains the current drive state of the vehicle.
type EnergySite ¶
type EnergySite struct { ID string `json:"id"` SiteName string `json:"site_name"` BackupReservePercent int64 `json:"backup_reserve_percent,omitempty"` DefaultRealMode string `json:"default_real_mode,omitempty"` // contains filtered or unexported fields }
this represents site_info endpoint
func (*EnergySite) EnergySiteHistory ¶
func (s *EnergySite) EnergySiteHistory(period HistoryPeriod) (*EnergySiteHistory, error)
func (*EnergySite) EnergySiteStatus ¶
func (s *EnergySite) EnergySiteStatus() (*EnergySiteStatus, error)
func (*EnergySite) SetBatteryReserve ¶
func (s *EnergySite) SetBatteryReserve(percent uint64) error
type EnergySiteHistory ¶
type EnergySiteHistory struct { SerialNumber string `json:"serial_number"` Period string `json:"period"` TimeSeries []EnergySiteHistoryTimeSeries `json:"time_series"` // contains filtered or unexported fields }
type EnergySiteHistoryTimeSeries ¶
type EnergySiteHistoryTimeSeries struct { Timestamp time.Time `json:"timestamp"` SolarEnergyExported float64 `json:"solar_energy_exported"` GeneratorEnergyExported float64 `json:"generator_energy_exported"` GridEnergyImported float64 `json:"grid_energy_imported"` GridServicesEnergyImported float64 `json:"grid_services_energy_imported"` GridServicesEnergyExported float64 `json:"grid_services_energy_exported"` GridEnergyExportedFromSolar float64 `json:"grid_energy_exported_from_solar"` GridEnergyExportedFromGenerator float64 `json:"grid_energy_exported_from_generator"` GridEnergyExportedFromBattery float64 `json:"grid_energy_exported_from_battery"` BatteryEnergyExported float64 `json:"battery_energy_exported"` BatteryEnergyImportedFromGrid float64 `json:"battery_energy_imported_from_grid"` BatteryEnergyImportedFromSolar float64 `json:"battery_energy_imported_from_solar"` BatteryEnergyImportedFromGenerator float64 `json:"battery_energy_imported_from_generator"` ConsumerEnergyImportedFromGrid float64 `json:"consumer_energy_imported_from_grid"` ConsumerEnergyImportedFromSolar float64 `json:"consumer_energy_imported_from_solar"` ConsumerEnergyImportedFromBattery float64 `json:"consumer_energy_imported_from_battery"` ConsumerEnergyImportedFromGenerator float64 `json:"consumer_energy_imported_from_generator"` }
type EnergySiteStatus ¶
type EnergySiteStatus struct { ResourceType string `json:"resource_type"` SiteName string `json:"site_name"` GatewayId string `json:"gateway_id"` EnergyLeft float64 `json:"energy_left"` TotalPackEnergy uint64 `json:"total_pack_energy"` PercentageCharged float64 `json:"percentage_charged"` BatteryType string `json:"battery_type"` BackupCapable bool `json:"backup_capable"` BatteryPower int64 `json:"battery_power"` // contains filtered or unexported fields }
type GuiSettings ¶
type GuiSettings struct { Timestamp timeMsec `json:"timestamp"` GuiDistanceUnits string `json:"gui_distance_units"` GuiTemperatureUnits string `json:"gui_temperature_units"` GuiChargeRateUnits string `json:"gui_charge_rate_units"` Gui24HourTime bool `json:"gui_24_hour_time"` GuiRangeDisplay string `json:"gui_range_display"` ShowRangeUnits bool `json:"show_range_units"` }
GuiSettings contains the current GUI settings of the vehicle.
type HistoryPeriod ¶
type HistoryPeriod string
const ( HistoryPeriodDay HistoryPeriod = "day" HistoryPeriodWeek HistoryPeriod = "week" HistoryPeriodMonth HistoryPeriod = "month" HistoryPeriodYear HistoryPeriod = "year" )
type Identifier ¶
type Identifier string
func (*Identifier) UnmarshalJSON ¶
func (i *Identifier) UnmarshalJSON(data []byte) error
type MeResponse ¶
type MeResponse struct {
Response *Me `json:"response"`
}
type MobileEnabledResponse ¶
type MobileEnabledResponse struct {
Bool bool `json:"response"`
}
MobileEnabledResponse is the response when a state is requested.
type NearbyChargingSitesResponse ¶
type NearbyChargingSitesResponse struct { Response struct { CongestionSyncTimeUtcSecs timeSecs `json:"congestion_sync_time_utc_secs"` DestinationCharging []struct { Location struct { Lat float64 `json:"lat"` Long float64 `json:"long"` } `json:"location"` Name string `json:"name"` Type string `json:"type"` DistanceMiles float64 `json:"distance_miles"` } `json:"destination_charging"` Superchargers []struct { Location struct { Lat float64 `json:"lat"` Long float64 `json:"long"` } `json:"location"` Name string `json:"name"` Type string `json:"type"` DistanceMiles float64 `json:"distance_miles"` AvailableStalls int `json:"available_stalls"` TotalStalls int `json:"total_stalls"` SiteClosed bool `json:"site_closed"` } `json:"superchargers"` Timestamp timeMsec `json:"timestamp"` } `json:"response"` }
NearbyChargingSitesResponse represents the charging sites returned from the API.
type Product ¶
type Product struct { EnergySiteId int64 `json:"energy_site_id,omitempty"` ResourceType string `json:"resource_type"` ID Identifier `json:"id"` AssetSiteId string `json:"asset_site_id,omitempty"` GatewayId string `json:"gateway_id,omitempty"` WarpSiteNumber string `json:"warp_site_number,omitempty"` EnergyLeft float64 `json:"energy_left,omitempty"` TotalPackEnergy uint64 `json:"total_pack_energy,omitempty"` PercentageCharged float64 `json:"percentage_charged,omitempty"` BatteryType string `json:"battery_type,omitempty"` BackupCapable bool `json:"backup_capable,omitempty"` BatteryPower int64 `json:"battery_power,omitempty"` // contains filtered or unexported fields }
type ProductsResponse ¶
ProductResponse contains the product details from the Tesla API.
type RegionResponse ¶
type RegionResponse struct {
Response *Region `json:"response"`
}
type SentryData ¶
type SentryData struct {
Mode string `json:"on"`
}
SentryData shows whether Sentry is on.
type ServiceData ¶
type ServiceData struct { Timestamp timeMsec `json:"timestamp"` ServiceETC time.Time `json:"service_etc"` ServiceStatus string `json:"service_status"` }
ServiceData contains the service data of the vehicle.
type SiteCommandResponse ¶
type SiteCommandResponse struct { Response struct { Code int `json:"code"` Message string `json:"message"` } `json:"response"` }
SiteCommandResponse is the response from the Tesla API after POSTing a command.
type SiteHistoryResponse ¶
type SiteHistoryResponse struct {
Response *EnergySiteHistory `json:"response"`
}
type SiteInfoResponse ¶
type SiteInfoResponse struct {
Response *EnergySite `json:"response"`
}
type SiteStatusResponse ¶
type SiteStatusResponse struct {
Response *EnergySiteStatus `json:"response"`
}
type Vehicle ¶
type Vehicle struct { Color interface{} `json:"color"` DisplayName string `json:"display_name"` ID int64 `json:"id"` OptionCodes string `json:"option_codes"` VehicleID uint64 `json:"vehicle_id"` Vin string `json:"vin"` Tokens []string `json:"tokens"` State string `json:"state"` IDS string `json:"id_s"` RemoteStartEnabled bool `json:"remote_start_enabled"` CalendarEnabled bool `json:"calendar_enabled"` NotificationsEnabled bool `json:"notifications_enabled"` BackseatToken interface{} `json:"backseat_token"` BackseatTokenUpdatedAt interface{} `json:"backseat_token_updated_at"` AccessType string `json:"access_type"` InService bool `json:"in_service"` APIVersion int `json:"api_version"` CommandSigning string `json:"command_signing"` // contains filtered or unexported fields }
Vehicle represents the vehicle as returned from the Tesla API.
func (*Vehicle) AutoparkAbort ¶
AutoparkAbort causes the vehicle to abort the Autopark request.
func (*Vehicle) AutoparkForward ¶
AutoparkForward causes the vehicle to pull forward.
func (*Vehicle) AutoparkReverse ¶
AutoparkReverse causes the vehicle to go in reverse.
func (Vehicle) Data ¶
func (v Vehicle) Data() (*VehicleData, error)
Data : Get data of the vehicle (calling this will not permit the car to sleep)
func (*Vehicle) EnableSentry ¶
EnableSentry enables Sentry Mode
func (*Vehicle) FlashLights ¶
FlashLights flashes the lights of the vehicle.
func (*Vehicle) MobileEnabled ¶
MobileEnabled returns if the vehicle is mobile enabled for Tesla API control
func (*Vehicle) MovePanoRoof ¶
MovePanoRoof sets the desired state of the panoramic roof. The approximate percent open values for each state are open = 100%, close = 0%, comfort = 80%, vent = %15, move = set %.
func (*Vehicle) NearbyChargingSites ¶
func (v *Vehicle) NearbyChargingSites() (*NearbyChargingSitesResponse, error)
NearbyChargingSites returns the charging sites near the vehicle.
func (*Vehicle) OpenChargePort ¶
OpenChargePort opens the charge port so you may insert your charging cable.
func (*Vehicle) ResetValetPIN ¶
ResetValetPIN resets the PIN set for valet mode, if set.
func (*Vehicle) SetChargeLimit ¶
SetChargeLimit set the charge limit to a custom percentage.
func (*Vehicle) SetChargeLimitMax ¶
SetChargeLimitMax sets the charge limit to the max limit.
func (*Vehicle) SetChargeLimitStandard ¶
SetChargeLimitStandard sets the charge limit to the standard setting.
func (*Vehicle) SetChargingAmps ¶
SetChargingAmps set the charging amps to a specific value.
func (*Vehicle) SetSeatHeater ¶
SetSeatHeater sets the specified seat's heater level.
func (*Vehicle) SetSteeringWheelHeater ¶
SetSteeringWheelHeater turns steering wheel heater on or off.
func (*Vehicle) SetTemperature ¶
SetTemperature sets the temperature of the vehicle, where you may set the driver zone and the passenger zone to separate temperatures.
func (*Vehicle) Start ¶
Start starts the car by turning it on, requires the password to be sent again.
func (*Vehicle) StartAirConditioning ¶
StartAirConditioning starts the air conditioning in the vehicle.
func (*Vehicle) StartCharging ¶
StartCharging starts the charging of the vehicle after you have inserted the charging cable.
func (*Vehicle) StopAirConditioning ¶
StopAirConditioning stops the air conditioning in the vehicle.
func (*Vehicle) StopCharging ¶
StopCharging stops the charging of the vehicle.
func (*Vehicle) TriggerHomelink ¶
TriggerHomelink opens and closes the configured Homelink garage door of the vehicle keep in mind this is a toggle and the garage door state is unknown a major limitation of Homelink.
func (*Vehicle) UnlockDoors ¶
UnlockDoors unlock the vehicle's doors.
func (*Vehicle) WindowControl ¶
Controls the windows. Will vent or close all windows simultaneously. command can be "vent" or "close". lat and lon values must be near the current location of the car for close operation to succeed. For vent, the lat and lon values are ignored, and may both be 0 (which has been observed from the app itself).
func (*Vehicle) WithClient ¶
WithClient returns a copy of the vehicle with new client. Use e.g. when creating a secondary client for executing signed commands using Tesla Proxy.
type VehicleConfig ¶
type VehicleConfig struct { CanActuateTrunks bool `json:"can_actuate_trunks"` CarSpecialType string `json:"car_special_type"` CarType string `json:"car_type"` ChargePortType string `json:"charge_port_type"` DefaultChargeToMax bool `json:"default_charge_to_max"` DriverAssist string `json:"driver_assist"` EceRestrictions bool `json:"ece_restrictions"` EfficiencyPackage string `json:"efficiency_package"` EUVehicle bool `json:"eu_vehicle"` ExteriorColor string `json:"exterior_color"` ExteriorTrim string `json:"exterior_trim"` HasAirSuspension bool `json:"has_air_suspension"` HasLudicrousMode bool `json:"has_ludicrous_mode"` InteriorTrimType string `json:"interior_trim_type"` KeyVersion int `json:"key_version"` MotorizedChargePort bool `json:"motorized_charge_port"` PerformancePackage string `json:"performance_package"` Plg bool `json:"plg"` RearDriveUnit string `json:"rear_drive_unit"` RearSeatHeaters int `json:"rear_seat_heaters"` RearSeatType int `json:"rear_seat_type"` Rhd bool `json:"rhd"` RoofColor string `json:"roof_color"` SeatType int `json:"seat_type"` SpoilerType string `json:"spoiler_type"` SunRoofInstalled int `json:"sun_roof_installed"` ThirdRowSeats string `json:"third_row_seats"` Timestamp timeMsec `json:"timestamp"` TrimBadging string `json:"trim_badging"` UseRangeBadging bool `json:"use_range_badging"` WheelType string `json:"wheel_type"` }
VehicleConfig represents the configuration of a vehicle.
type VehicleData ¶
type VehicleData struct { Response struct { ChargeState ChargeState `json:"charge_state"` ClimateState ClimateState `json:"climate_state"` DriveState DriveState `json:"drive_state"` VehicleState VehicleState `json:"vehicle_state"` GuiSettings GuiSettings `json:"gui_settings"` VehicleConfig VehicleConfig `json:"vehicle_config"` } `json:"response"` Error string `json:"error"` ErrorDescription string `json:"error_description"` }
VehicleData represents the states of the vehicle.
type VehiclePartialResponse ¶
type VehiclePartialResponse struct { Color interface{} `json:"color"` DisplayName string `json:"display_name"` ID int64 `json:"id"` OptionCodes string `json:"option_codes"` VehicleID uint64 `json:"vehicle_id"` Vin string `json:"vin"` Tokens []string `json:"tokens"` State string `json:"state"` IDS string `json:"id_s"` RemoteStartEnabled bool `json:"remote_start_enabled"` CalendarEnabled bool `json:"calendar_enabled"` NotificationsEnabled bool `json:"notifications_enabled"` BackseatToken interface{} `json:"backseat_token"` BackseatTokenUpdatedAt interface{} `json:"backseat_token_updated_at"` AccessType string `json:"access_type"` InService bool `json:"in_service"` APIVersion int `json:"api_version"` CommandSigning string `json:"command_signing"` }
VehiclePartialResponse represents the vehicle response root data as returned from the Tesla API.
type VehicleResponse ¶
VehicleResponse contains the vehicle details from the Tesla API.
type VehicleState ¶
type VehicleState struct { Timestamp timeMsec `json:"timestamp"` APIVersion int `json:"api_version"` AutoParkState string `json:"autopark_state"` AutoParkStateV2 string `json:"autopark_state_v2"` AutoParkStateV3 string `json:"autopark_state_v3"` CalendarSupported bool `json:"calendar_supported"` CarType string `json:"car_type"` CarVersion string `json:"car_version"` CenterDisplayState int `json:"center_display_state"` DarkRims bool `json:"dark_rims"` DriverFrontDoor int `json:"df"` DriverRearDoor int `json:"dr"` ExteriorColor string `json:"exterior_color"` FrontTrunk int `json:"ft"` HasSpoiler bool `json:"has_spoiler"` Locked bool `json:"locked"` NotificationsSupported bool `json:"notifications_supported"` Odometer float64 `json:"odometer"` ParsedCalendarSupported bool `json:"parsed_calendar_supported"` PerfConfig string `json:"perf_config"` PassengerFrontDoor int `json:"pf"` PassengerRearDoor int `json:"pr"` RearSeatHeaters int `json:"rear_seat_heaters"` RemoteStart bool `json:"remote_start"` RemoteStartSupported bool `json:"remote_start_supported"` RightHandDrive bool `json:"rhd"` RoofColor string `json:"roof_color"` RearTrunk int `json:"rt"` SentryMode bool `json:"sentry_mode"` SentryModeAvailable bool `json:"sentry_mode_available"` SeatType int `json:"seat_type"` SpoilerType string `json:"spoiler_type"` SunRoofInstalled int `json:"sun_roof_installed"` SunRoofPercentOpen int `json:"sun_roof_percent_open"` SunRoofState string `json:"sun_roof_state"` ThirdRowSeats string `json:"third_row_seats"` ValetMode bool `json:"valet_mode"` VehicleName string `json:"vehicle_name"` WheelType string `json:"wheel_type"` FrontDriverWindow int `json:"fd_window"` FrontPassengerWindow int `json:"fp_window"` RearDriverWindow int `json:"rd_window"` RearPassengerWindow int `json:"rp_window"` IsUserPresent bool `json:"is_user_present"` RemoteStartEnabled bool `json:"remote_start_enabled"` ValetPinNeeded bool `json:"valet_pin_needed"` MediaState struct { RemoteControlEnabled bool `json:"remote_control_enabled"` } `json:"media_state"` SoftwareUpdate struct { DownloadPerc int `json:"download_perc"` ExpectedDurationSec int `json:"expected_duration_sec"` InstallPerc int `json:"install_perc"` Status string `json:"status"` Version string `json:"version"` } `json:"software_update" ` SpeedLimitMode struct { Active bool `json:"active"` CurrentLimitMph float64 `json:"current_limit_mph"` MaxLimitMph float64 `json:"max_limit_mph"` MinLimitMph float64 `json:"min_limit_mph"` PinCodeSet bool `json:"pin_code_set"` } `json:"speed_limit_mode"` }
VehicleState contains the current state of the vehicle.
type VehiclesResponse ¶
VehiclesResponse contains a slice of Vehicles from the Tesla API.